Skip to content

Commit

Permalink
Merge pull request #125 from dbcls/feature/fix-text
Browse files Browse the repository at this point in the history
Feature/fix text
  • Loading branch information
sasaujp authored Feb 10, 2021
2 parents cbc2846 + b6cb2c5 commit e174c67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion node/src/ts/visualizer/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
7 changes: 5 additions & 2 deletions node/src/ts/visualizer/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit e174c67

Please sign in to comment.