diff --git a/node/src/ts/visualizer/locales/en.ts b/node/src/ts/visualizer/locales/en.ts index 135a144e..01d3206c 100644 --- a/node/src/ts/visualizer/locales/en.ts +++ b/node/src/ts/visualizer/locales/en.ts @@ -7,7 +7,7 @@ const messages = { 'detail.class.selecting': 'Selected Class', 'detail.no.selecting.classes': 'No classes currently selected.', 'focusClassDetail.class.selecting': 'Selected Class', - 'classRelationsDetail.class.relates': 'Relating Class', + 'classRelationsDetail.class.relates': 'Related Class', 'classRelationsDetail.class.relates.of': 'Class relating to {target}', 'classRelationsDetail.triple.with.this.class.as.subject': 'Triples whose subjects are this class', diff --git a/node/src/ts/visualizer/utils/index.ts b/node/src/ts/visualizer/utils/index.ts index 3b8eec52..569bbbba 100644 --- a/node/src/ts/visualizer/utils/index.ts +++ b/node/src/ts/visualizer/utils/index.ts @@ -8,8 +8,11 @@ export const getPreferredLabel = ( locale: string ): string => { const detail = classes[uri] - const label = detail?.label ? detail.label[locale] || detail.label[''] : null - + const labels = detail?.label + if (!labels) { + return uri + } + const label = labels[locale] || labels.en || labels[''] || null return label || uri }