Skip to content

Commit

Permalink
feat: always use browser locale for the language list
Browse files Browse the repository at this point in the history
avoids making it difficult to switch back if an unknown language is picked accidentally
  • Loading branch information
simonwep committed Jan 3, 2025
1 parent f810606 commit b83d48d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/pages/navigation/language/ChangeLanguageButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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<ContextMenuOption[]>(() => {
const displayNames = new Intl.DisplayNames(locale.value, { type: 'language' });
const displayNames = new Intl.DisplayNames(initialLocale, { type: 'language' });
return availableLocales.map((value) => ({
id: value,
Expand Down

0 comments on commit b83d48d

Please sign in to comment.