max-mapper / max-mapper/browser-locale
Chrome browser language not necessarily first in languages list
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 104
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
It seems that in the latest version of Chrome (v. 59.0.3071.115), the display language is not necessarily the first one in the window.navigator.languages list (so taking languages[0] gets a wrong result).
See screenshots below:
Chrome navigator

Chrome settings

Maybe it would be an idea to take into account the window.navigator.language value first and, if not found, use the first entry in the window.navigator.languages array.
P.S.: As far as I could see, now even the latest versions of IE and Edge set the window.navigator.language value.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the JavaScript locale-detection entry point and how it currently reads window.navigator.languages. Verify the reported Chrome behavior, then use window.navigator.language as the preferred value with the languages list as fallback. Done means the selected locale matches the browser display language while preserving fallback behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- internationalization
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100