Skip to content

Commit

Permalink
Merge pull request #1503 from zazuko/no-translation
Browse files Browse the repository at this point in the history
show dimension URL if no translation (#1317)
  • Loading branch information
giacomociti authored May 22, 2024
2 parents 5b45771 + 9e42dda commit 35827a0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/shy-crabs-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cube-creator/ui": patch
---

Use another language or IRI when missing translation
10 changes: 8 additions & 2 deletions ui/src/components/TermWithLanguage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@ export default defineComponent({
computed: {
value (): string | undefined {
if (Array.isArray(this.values)) {
const term =
let term =
this.values?.find(({ language }) => language === this.selectedLanguage) ||
this.values?.find(({ language }) => !language)
if (term) return term.value
return term?.value
for (const lang of displayLanguage) {
term = this.values?.find(({ language }) => language === lang)
if (term) return `${term.value} (${term.language})`
}
return undefined
}
const term = this.values?.filter(taggedLiteral([
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/SharedDimensions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<div class="is-flex-grow-1 is-flex is-justify-content-space-between is-flex-direction-column">
<div class="has-text-weight-bold">
<term-with-language :values="dimension.names" :selected-language="selectedLanguage">
<i>No translation for {{ selectedLanguage }}</i>
<i> &lt;{{ dimension.id.value }}&gt; </i> <small>(No translation for {{ selectedLanguage }})</small>
</term-with-language>
</div>
<p class="abbreviations is-size-7">
Expand Down

0 comments on commit 35827a0

Please sign in to comment.