fix: missed language code fallback (#1559)
parent
a025b3b434
commit
cf76ba3114
|
@ -9,7 +9,7 @@ export default defineNuxtPlugin(async (nuxt) => {
|
||||||
|
|
||||||
const supportLanguages = (locales as LocaleObject[]).map(locale => locale.code)
|
const supportLanguages = (locales as LocaleObject[]).map(locale => locale.code)
|
||||||
if (!supportLanguages.includes(lang))
|
if (!supportLanguages.includes(lang))
|
||||||
userSettings.value.language = getDefaultLanguage(locales as string[])
|
userSettings.value.language = getDefaultLanguage(supportLanguages)
|
||||||
|
|
||||||
watch([$$(lang), isHydrated], () => {
|
watch([$$(lang), isHydrated], () => {
|
||||||
if (isHydrated.value && lang !== i18n.locale)
|
if (isHydrated.value && lang !== i18n.locale)
|
||||||
|
|
Loading…
Reference in New Issue