diff --git a/components/publish/PublishLanguagePicker.vue b/components/publish/PublishLanguagePicker.vue index 6e58d524..c8827d45 100644 --- a/components/publish/PublishLanguagePicker.vue +++ b/components/publish/PublishLanguagePicker.vue @@ -6,6 +6,7 @@ let { modelValue } = $defineModel<{ }>() const { t } = useI18n() +const userSettings = useUserSettings() const languageKeyword = $ref('') @@ -17,9 +18,22 @@ const fuse = new Fuse(languagesNameList, { const languages = $computed(() => languageKeyword.trim() ? fuse.search(languageKeyword).map(r => r.item) - : [...languagesNameList].sort(({ code: a }, { code: b }) => { - return a === modelValue ? -1 : b === modelValue ? 1 : a.localeCompare(b) - }), + : [...languagesNameList].filter(entry => !userSettings.value.disabledTranslationLanguages.includes(entry.code)) + .sort(({ code: a }, { code: b }) => { + return a === modelValue ? -1 : b === modelValue ? 1 : a.localeCompare(b) + }), +) + +const preferredLanguages = computed(() => { + const result = [] + for (const langCode of userSettings.value.disabledTranslationLanguages) { + const completeLang = languagesNameList.find(listEntry => listEntry.code === langCode) + if (completeLang) + result.push(completeLang) + } + return result +}, + ) function chooseLanguage(language: string) { @@ -38,6 +52,18 @@ function chooseLanguage(language: string) { >