Default locale & browser language detection confusion
See original GitHub issueVersion
Reproduction link
https://github.com/nuxt-community/nuxt-i18n
Steps to reproduce
Quoting @mapeal2 https://cmty.app/nuxt/nuxt-i18n/issues/c96
Given 2 locales ('en', 'fr'), default locale is 'en' and the preferred browser language is 'fr', with the 'prefixexceptdefault' option, the steps to reproduce it would be:
Visit home page '/' --> browser language is detected and redirected to '/fr', which is correct.
Close the browser.
Open a new browser and enter the home page ('/') again
What is expected ?
I would expect that, when opening the home page again, the application would be redirected to '/fr' instead of staying in '/'.
What is actually happening?
'en' locale is chosen, ignoring cookie.
<div align="right">This bug report is available on Nuxt community (#c116)</div>Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Default locale & browser language detection confusion · Issue ...
Given 2 locales ('en', 'fr'), default locale is 'en' and the preferred browser language is 'fr', with the 'prefixexceptdefault' option, ...
Read more >Solved: How to Detect a User's Locale in a Web App | Phrase
In this article, we'll go through three different ways of detecting a user's locale: through the browser's navigator. language s (on the client ......
Read more >Browser language detection and redirect vs Google Robots
I try to automatically detect browser language and redirect user to proper page according to his language. Site is bilingual, default ...
Read more >Identifying Language and Locale with DeviceAtlas
For a default browser, this data is highly indicative of the language of the user of the device as well as the local...
Read more >Language and locale resolution overview - Android Developers
Your app's default language is en_US (US English), and it also has Spanish strings localized in es_ES resource files.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fix is integrated. This can be resolved.
Same bug with v5.4.4 of nuxt-i18n (inspired by nuxt-i18n example of @paulgv )
(alwaysRedirect variable found here : https://github.com/nuxt-community/nuxt-i18n/pull/148/commits/38b0cbbf9033e5ffe128aa776e0f6f4ee03076af)