Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Nuxt i18n load language from cookie - Nuxt
N
Nuxt
•
2y ago
•
1 reply
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
setLocale
or
setLocaleCookie
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})
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
?
Stack Overflow
Change nuxt-i18n locale with cookie on site load
I
've two locale
;
"fa
" and
"en
" with fa being default
. I
've tried to change it with the following code block both on nuxtServerInit and fetch hook of layout but it still revert b
.
.
.
Nuxt
Join
Nuxt Community Chat Server
31,817
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Nuxt-i18n language switcher
N
Nuxt / ❓・help
10mo ago
Nuxt i18n not keeping language
N
Nuxt / ❓・help
16mo ago
nuxt-i18n dynamically load translations
N
Nuxt / ❓・help
2y ago