🐞 fix: i18n 读写 key 不一致

This commit is contained in:
m1m1sha 2024-05-07 10:40:12 +08:00
parent e9a625ec5f
commit 8188585edd
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ const router = createRouter({
app.use(router)
app.use(createPinia())
app.use(i18n, { useScope: 'global' })
loadLanguageAsync(localStorage.getItem('lang') || 'en')
await loadLanguageAsync(localStorage.getItem('lang') || 'en')
app.use(PrimeVue)
app.use(ToastService)

View File

@ -21,7 +21,7 @@ const loadedLanguages: string[] = []
function setI18nLanguage(lang: Locale) {
i18n.global.locale.value = lang as any
localStorage.setItem('locale', lang)
localStorage.setItem('lang', lang)
return lang
}