Load all locale once in browser environnement
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Not a bug, but actually i have to load every local i want to use this way:
``
My problem is that i want to handle any language the user could have set in his browser using navigator.language :
`let mDate = dayjs(date, formats, 'navigator.language').utc(true).format()`
but without adding all that for all languages available in my .html
**Expected behavior**
I wish a could do it as i use to with momentjs:
``
This include all available locale at once.
Also it seems it could be usefull for anyone trying to dynamicaly get the right locale
I would appreciate any guidance or suggestions from the community on how to achieve this more efficiently
**Information**
- Day.js Version 1.11.10
- OS: windows
- Browser Edge
Contributor guide
Research direction
Start by reviewing how Day.js browser scripts load locale files and how navigator.language is expected to select one. Compare the requested behavior with Moment.js's locales.js example. Done means a documented or implemented way to make all available locales usable without adding one script tag per locale, with the expected browser behavior covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- localization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100