question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set locale on single instance

See original GitHub issue

Seems 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:open
  • Created 6 years ago
  • Reactions:12
  • Comments:7

github_iconTop GitHub Comments

1reaction
francisrod01commented, Nov 26, 2017

I agree!!

0reactions
Noitidartcommented, Feb 5, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found