Skip to content

Commit

Permalink
coalesce languages
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomociti committed Apr 24, 2024
1 parent d340ab4 commit 2ee3c52
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit 2ee3c52

Please sign in to comment.