diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f16df0..88fe5d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ As this project is a user-facing application, the places in the semantic version ## [Unreleased] +### Fixed + +- Set `lang` param of Korp/Strix urls + ## [1.0.4] (2023-10-24) ### Fixed diff --git a/src/corpus/exports/Exports.vue b/src/corpus/exports/Exports.vue index f00deb8..7f4e252 100644 --- a/src/corpus/exports/Exports.vue +++ b/src/corpus/exports/Exports.vue @@ -16,7 +16,7 @@ :link-text="$t('exports.tools.help.korp.manual.text')" :can-install="canInstall" :is-installed="korpStatus.isDone" - :show-url="`${korpUrl}?mode=mink#?corpus=${corpusId}`" + :show-url="`${korpUrl}?mode=mink#?corpus=${corpusId}&lang=${locale3}`" @install="korpInstall()" /> @@ -25,7 +25,7 @@ :info="$t('exports.tools.help.strix')" :can-install="canInstall" :is-installed="strixStatus.isDone" - :show-url="`${strixUrl}?filters=corpus_id:${corpusId}&modeSelected=mink`" + :show-url="`${strixUrl}?modeSelected=mink&filters=corpus_id:${corpusId}&lang=${locale3}`" @install="strixInstall()" /> @@ -67,6 +67,7 @@ import { useCorpusState } from "@/corpus/corpusState.composable"; import useJob from "@/corpus/job/job.composable"; import PendingContent from "@/spin/PendingContent.vue"; import ToolPanel from "./ToolPanel.vue"; +import useLocale from "@/i18n/locale.composable"; const corpusId = useCorpusIdParam(); const { exports, loadExports, downloadResult, getDownloadFilename } = @@ -74,6 +75,7 @@ const { exports, loadExports, downloadResult, getDownloadFilename } = const { isDone } = useCorpusState(corpusId); const { installKorp, installStrix, sparvStatus, korpStatus, strixStatus } = useJob(corpusId); +const { locale3 } = useLocale(); const korpUrl = ensureTrailingSlash(import.meta.env.VITE_KORP_URL); const strixUrl = ensureTrailingSlash(import.meta.env.VITE_STRIX_URL); diff --git a/src/i18n/locale.composable.js b/src/i18n/locale.composable.js index 9b3e92e..477615c 100644 --- a/src/i18n/locale.composable.js +++ b/src/i18n/locale.composable.js @@ -1,4 +1,4 @@ -import { inject, watch } from "vue"; +import { computed, inject, watch } from "vue"; import { useI18n } from "vue-i18n"; import { useStorage } from "@vueuse/core"; import { filesize } from "filesize"; @@ -14,6 +14,11 @@ export default function useLocale() { document.querySelector("html")?.setAttribute("lang", locale.value); }; + // The ISO 639-3 code is used in many parts of the Språkbanken infrastructure. + const locale3 = computed( + () => console.log(locale.value) || (locale.value == "en" ? "eng" : "swe") + ); + // Sync from storage once, if present if (storedLocale.value) { locale.value = storedLocale.value; @@ -50,6 +55,7 @@ export default function useLocale() { return { locale, + locale3, th, filesize: myFilesize, };