Skip to content

Commit

Permalink
fix(i18n): auto locale always using fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
ferferga authored Sep 4, 2023
1 parent 3047b68 commit 836b9ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion frontend/src/components/System/LocaleSwitcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<VMenu>
<VList class="overflow-y-auto">
<VListItem
:value="clientSettings.locale === 'auto'"
:title="$t('auto')"
@click="clientSettings.locale = 'auto'" />
<VDivider />
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/store/clientSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,9 @@ class ClientSettingsStore {
public set locale(newVal: string) {
const i18n = usei18n();

if (!i18n.availableLocales.includes(newVal) && newVal !== 'auto') {
throw new TypeError('This locale has not been registered');
}

this._state.value.locale =
newVal === 'auto' ? String(i18n.fallbackLocale.value) : newVal;
i18n.availableLocales.includes(newVal) && newVal !== 'auto'
? newVal : 'auto';
}

public get locale(): string {
Expand Down

0 comments on commit 836b9ec

Please sign in to comment.