-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preferred language is not saved in the cookie #57
Comments
On the first visit to the website, the locale is determined and the user is redirected to the page corresponding to the detected locale. On subsequent visits, the user is taken to the same link they accessed, meaning the locale determination does not occur again. As far as I remember, i18n works similarly. |
you can try it in the demo, ideally in the anonymous window, https://stackblitz.com/github/kleinpetr/nuxt-content-i18n_micro
|
You haven't enabled the autoDetectLanguage option, but after enabling redirects, it started working. The only thing I want to clarify is that I’m using a 301 redirect, and because of this, the browser remembers the redirect and performs it automatically when reopening the page. I could try switching to a 302, which should theoretically solve the issue. |
we have already set |
try v1.30.1 I changed the redirect to 302. For re-detecting the locale, additional logic needs to be added, but I haven't done it yet. I'll look into it when I have time. Currently, it works as follows:
If you have time, you can try implementing the logic for re-redirecting yourself. You'll just need to add an option to enable this feature. I'll try to find time for it later. |
So it means, when user switch the locale, it is not saved in the cookie, right? so there is nothing like "preferred language" which would be kept for another visit. |
yes that's true |
I would like to know what should be the expected behavior of the cookie
user-locale
My Expectation
// having en-US browser
en
locale - detected by browsercs
or any other lang - now the cookie should change tocs
valuecs
localeThis is how standard
i18n
works imo.Thanks for clarification
The text was updated successfully, but these errors were encountered: