Skip to content

Commit

Permalink
Language and translation setup generalization
Browse files Browse the repository at this point in the history
  • Loading branch information
anwolosz committed Aug 24, 2024
1 parent 45d67f0 commit e064909
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/components/FunctionButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default {
}, 1500);
},
copyIdLink(id: string) {
navigator.clipboard.writeText(window.location.origin + "/" + this.$route.params.lang + "/" + this.$route.params.translation + "#" + id);
navigator.clipboard.writeText(window.location.origin + "/" + this.$route.params.language + "/" + this.$route.params.translation + "#" + id);
this.isIdCopied = true
setTimeout(() => {
this.isIdCopied = false;
Expand Down
24 changes: 10 additions & 14 deletions src/stores/SynopsisStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,19 @@ export const useSynopsisStore = defineStore('synopsis', {
return result
},
setupLanguage(language: any) {
if (language !== "en") {
this.currentDictionary = dictionaryHu
this.currentLanguage = "hu"
}
else {
this.currentDictionary = dictionaryEn
this.currentLanguage = "en"
for (let synopsisIndex = 0; synopsisIndex < this.synopses.length; synopsisIndex++) {
if (language === this.synopses[synopsisIndex].language) {
this.currentDictionary = dictionary[language]
this.currentLanguage = language
}
}
},
setupTranslation(translation: any) {
if (translation === "SZIT") {
this.currentTranslation = "SZIT"
this.currentSynopsis = synopsisSZIT
}
if (translation === "ESV") {
this.currentTranslation = "ESV"
this.currentSynopsis = synopsisESV
for (let synopsisIndex = 0; synopsisIndex < this.synopses.length; synopsisIndex++) {
if (translation === this.synopses[synopsisIndex].translation) {
this.currentTranslation = translation
this.currentSynopsis = this.synopses[synopsisIndex]
}
}
}
}
Expand Down

0 comments on commit e064909

Please sign in to comment.