Does not pick up browser locale settings anymore
See original GitHub issueDescribe the bug Luxon 2 does not pick up the browser locale anymore.
- Settings.defaultLocale is
null
- systemLocale had its detection functionality removed
To Reproduce Use a non-English browser and output a DateTime.toLocaleString() without setting any locales.
Actual vs Expected behavior Expected: The date is output in the browser language. (This works in Luxon ^1) Actual: The date is output in en-US.
Desktop (please complete the following information):
- OS: Win10
- Browser: Chrome92
- Luxon version: 2.0.1
- Your timezone: Europe/Berlin
Additional context the detection was removed here: https://github.com/moment/luxon/commit/6bb7488b8a2869c6f1b70ca7fac55f9e2e439485#diff-572c92ef1c461030cf7e47772319dd3db1ec2b880dadca7f88a3d9cee8e22ca3L46-L50
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:12 (3 by maintainers)
Top Results From Across the Web
JavaScript for detecting browser language preference [duplicate]
I have been trying to detect the browser language preference using JavaScript. If I set the browser language in IE in Tools>Internet Options>General>Languages...
Read more >Preferred language settings are ignored or changed when in ...
If your Google Searches are using the wrong country service, the first thing to do is report the problem so Google can update...
Read more >Why does Google use location for language rather than ...
The browser setting that every browser sends to any server it requests data from. Usually this defaults to the system language, but you...
Read more >Solved: How to Detect a User's Locale in a Web App | Phrase
The codes for the locales match the ones in our browser settings ... When an explicit q value is not specified, a default...
Read more >Can I set a different preferred language per site? - Super User
On Firefox, you can use the lightweight Quick Accept-Language Switcher extension and change the locale every time you access that site.
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 Free
Top 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
The issue still seems to be present in v3.0.3 as well - my local is en-NZ (when checked with
navigator.language
) but Luxon is usingen-GB
(when checked withDateTime.local()
)@icambron Same issue on luxon 3.0.1.
navigator.language
prints the correct locale but luxon is still usingen-GB
.