fix: remove flashing text on page reload (#1939)

This commit is contained in:
Joaquín Sánchez 2023-04-16 21:33:51 +02:00 committed by GitHub
parent 13581323b0
commit c71259334c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 88 additions and 61 deletions

View file

@ -11,6 +11,9 @@ export default defineNuxtPlugin(async (nuxt) => {
if (!supportLanguages.includes(lang))
userSettings.value.language = getDefaultLanguage(supportLanguages)
if (lang !== i18n.locale)
await setLocale(userSettings.value.language)
watch([$$(lang), isHydrated], () => {
if (isHydrated.value && lang !== i18n.locale)
setLocale(lang)