N
Nuxt4mo ago
Yveeven

When using the i18n module to switch languages, you need to refresh the page to take effect.

No description
No description
4 Replies
pyplacca
pyplacca4mo ago
Try this
const { locale, locales, setLocaleCookie } = useI18n()
const switchLocalePath = useSwitchLocalePath()

function changeLanguage(code: string): void {
setLocaleCookie(code)
navigateTo(switchLocalePath(code), {
replace: true,
})
}
const { locale, locales, setLocaleCookie } = useI18n()
const switchLocalePath = useSwitchLocalePath()

function changeLanguage(code: string): void {
setLocaleCookie(code)
navigateTo(switchLocalePath(code), {
replace: true,
})
}
Yveeven
YveevenOP4mo ago
Yveeven
YveevenOP4mo ago
It didn't work. It was strange.
Yveeven
YveevenOP4mo ago
No description
Want results from more Discord servers?
Add your server