You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# here import from @vueuse/core
const state = useStorage('general-settings', { lang: 'en' })
export const install: UserModule = ({ app }) => {
app.use(i18n)
loadLanguageAsync(state.value.lang)
}
also when user changes you need to set selected to storage to read from local storage.
function setI18nLanguage(lang: Locale) {
state.value.lang = lang
i18n.global.locale.value = lang as any
if (typeof document !== 'undefined')
document.querySelector('html')?.setAttribute('lang', lang)
return lang
}
Describe the bug
iShot_2023-10-30_08.24.56.mp4
As you can see in the video, I switched the colour theme to bright colours, as well as switching the language
And then refreshed the page
After that, the colour theme is still bright, but the language is back to English
So, I think we should make the language preference persistent in the browser as well
Reproduction
https://vitesse.netlify.app/
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: