Skip to content

Commit b83d48d

Browse files
committed
feat: always use browser locale for the language list
avoids making it difficult to switch back if an unknown language is picked accidentally
1 parent f810606 commit b83d48d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/pages/navigation/language/ChangeLanguageButton.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import Button from '@components/base/button/Button.vue';
1616
import { ContextMenuOption } from '@components/base/context-menu/ContextMenu.types';
1717
import ContextMenu from '@components/base/context-menu/ContextMenu.vue';
18-
import { AvailableLocale, availableLocales } from '@i18n/index';
18+
import { AvailableLocale, availableLocales, initialLocale } from '@i18n/index';
1919
import { RiCheckLine, RiGlobalLine } from '@remixicon/vue';
2020
import { useDataStore } from '@store/state';
2121
import { ClassNames } from '@utils';
@@ -26,13 +26,13 @@ const props = defineProps<{
2626
class?: ClassNames;
2727
}>();
2828
29-
const { t, locale } = useI18n();
29+
const { t } = useI18n();
3030
const { changeLocale, state } = useDataStore();
3131
3232
const classes = computed(() => props.class);
3333
3434
const locales = computed<ContextMenuOption[]>(() => {
35-
const displayNames = new Intl.DisplayNames(locale.value, { type: 'language' });
35+
const displayNames = new Intl.DisplayNames(initialLocale, { type: 'language' });
3636
3737
return availableLocales.map((value) => ({
3838
id: value,

0 commit comments

Comments
 (0)