I need to manually set the user's locale and get access to it in
getStaticProps for a multilingual static site.
I have 2 questions.
- Is it possible to create a multilingual website without having language in the subpath or as a domain?
- Why is
NEXT_LOCALEcookie wrong? I set the cookie to
meand it says that locale is
en. I get
meas a locale only when I go to
All I could find about the cookie is this sentence in the docs
Next.js supports overriding the accept-language header with a NEXT_LOCALE=the-locale cookie. This cookie can be set using a language switcher and then when a user comes back to the site it will leverage the locale specified in the cookie.
For example, if a user prefers the locale fr but a NEXT_LOCALE=en cookie is set the en locale will be used instead until the cookie is removed or expired.
Judging by this, the
NEXT_LOCALE cookie should be read instead of subpath or from the domain, but in my case, the
NEXT_LOCALE cookie is totally ignored.
Does this have something to do with
"next": "10.0.5". Do I need to downgrade?
Or could it be that I misunderstood something?