Pable
Nuxt i18n load language from cookie
I have the exact same problem than the person in this thread: https://stackoverflow.com/questions/71998762/change-nuxt-i18n-locale-with-cookie-on-site-load
I want to use Nuxt i18n, make it save the current locale on change when calling
setLocale
or setLocaleCookie
(in a cookie or anywhere), and load it back again on a page reload.
Unfortunately, every time I reload the page, the apps keeps using the default value set in defineI18nConfig({locale})
(in i18n.config.ts), the cookie is set back to the default value as well.
I do NOT want to use URL based locale. I'm using all default config values.
What did I do wrong?2 replies