Skip to content

Commit

Permalink
fix: missed language code fallback (#1559)
Browse files Browse the repository at this point in the history
  • Loading branch information
skryukov committed Feb 2, 2023
1 parent a025b3b commit cf76ba3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/setup-i18n.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default defineNuxtPlugin(async (nuxt) => {

const supportLanguages = (locales as LocaleObject[]).map(locale => locale.code)
if (!supportLanguages.includes(lang))
userSettings.value.language = getDefaultLanguage(locales as string[])
userSettings.value.language = getDefaultLanguage(supportLanguages)

watch([$$(lang), isHydrated], () => {
if (isHydrated.value && lang !== i18n.locale)
Expand Down

0 comments on commit cf76ba3

Please sign in to comment.