diff --git a/src/components/FunctionButtons.vue b/src/components/FunctionButtons.vue index e3f2663f..268d0be3 100644 --- a/src/components/FunctionButtons.vue +++ b/src/components/FunctionButtons.vue @@ -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; diff --git a/src/stores/SynopsisStore.ts b/src/stores/SynopsisStore.ts index 8f141be2..147e89c8 100644 --- a/src/stores/SynopsisStore.ts +++ b/src/stores/SynopsisStore.ts @@ -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] + } } } }