Set locale on single instance
See original GitHub issueSeems like the locale can only be set globally, e.g. numeral.locale('it'). This may cause problems with async callbacks causing them to pick the wrong locale, if multiple locales are involved.
It should be possibile to set the locale for a single instance, e.g.
numeral(3.14).locale('it').format('0,00.00');
Issue Analytics
- State:
- Created 6 years ago
- Reactions:12
- Comments:7
Top Results From Across the Web
Changing locales locally - momentjs.com
A global locale configuration can be problematic when passing around moments that may need to be formatted into different locale. moment.locale('en'); // ...
Read more >How to Change or Set System Locales in Linux - Tecmint
If you want to change or set system local, use the update-locale program. The LANG variable allows you to set the locale for...
Read more >Rythm: create new engine or set Language/Locale on existing ...
I could do this: engine.setLocale(userLocale); engine.render(template,arguments);. I assume that if I use a singleton(or single instance created ...
Read more >setlocale, _wsetlocale | Microsoft Learn
Use the setlocale function to set, change, or query some or all of the current program locale information specified by locale and category...
Read more >app | Electron
To set the locale, you'll want to use a command line switch at app startup ... On macOS, the system enforces single instance...
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

I agree!!
Has anyone found another library for this issue? I’m using it in the backend and need to use a fixed locale per request.