forked from Mirrors/elk
fix: missed language code fallback (#1559)
This commit is contained in:
parent
a025b3b434
commit
cf76ba3114
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue