From b83d48dbea7b8639c2b265e6452ee253ec05cd97 Mon Sep 17 00:00:00 2001 From: Simon Reinisch Date: Fri, 3 Jan 2025 15:00:35 +0100 Subject: [PATCH] feat: always use browser locale for the language list avoids making it difficult to switch back if an unknown language is picked accidentally --- src/app/pages/navigation/language/ChangeLanguageButton.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/pages/navigation/language/ChangeLanguageButton.vue b/src/app/pages/navigation/language/ChangeLanguageButton.vue index 38fbfe7..5c77f0b 100644 --- a/src/app/pages/navigation/language/ChangeLanguageButton.vue +++ b/src/app/pages/navigation/language/ChangeLanguageButton.vue @@ -15,7 +15,7 @@ import Button from '@components/base/button/Button.vue'; import { ContextMenuOption } from '@components/base/context-menu/ContextMenu.types'; import ContextMenu from '@components/base/context-menu/ContextMenu.vue'; -import { AvailableLocale, availableLocales } from '@i18n/index'; +import { AvailableLocale, availableLocales, initialLocale } from '@i18n/index'; import { RiCheckLine, RiGlobalLine } from '@remixicon/vue'; import { useDataStore } from '@store/state'; import { ClassNames } from '@utils'; @@ -26,13 +26,13 @@ const props = defineProps<{ class?: ClassNames; }>(); -const { t, locale } = useI18n(); +const { t } = useI18n(); const { changeLocale, state } = useDataStore(); const classes = computed(() => props.class); const locales = computed(() => { - const displayNames = new Intl.DisplayNames(locale.value, { type: 'language' }); + const displayNames = new Intl.DisplayNames(initialLocale, { type: 'language' }); return availableLocales.map((value) => ({ id: value,