Skip to content
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

detectBrowserLanguage doesn't work with defaultLocale - probably prefix_except_default or a cookie issue #3386

Closed
amini-amr opened this issue Mar 3, 2025 · 1 comment

Comments

@amini-amr
Copy link

Environment

Reproduction

https://stackblitz.com/edit/nuxt-starter-5gvqro5j?file=nuxt.config.ts

Describe the bug

detectBrowserLanguage doesn't work for the defaultLocale. It works for any other locales. The issue I noticed is that changing the locale using switchLocalePath() changes the cookie value. Still, not for the default one, so each time it gets redirected to the last locale set in cookies unless you change the cookie and change the URL to the default locale by yourself. The only solution I found for this issue is to ignore the use of cookies and setting the whole detectBrowserLanguage to false

Additional context

No response

Logs

@amini-amr
Copy link
Author

The solution is to use the setLocale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant