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.

Cannot use locales

See original GitHub issue

Inside my WebPack project, I am trying to use numeral.js like so:

import numeral from 'numeral'; export default function() { numeral.locale('de'); numeral(1234).format('0,0.000'); }

If I don’t register the locale, I get an error stating that the locale is undefined: numeral.js:198 Uncaught TypeError: Cannot read property 'delimiters' of undefined at numberToFormat (numeral.js:198) at Numeral.format (numeral.js:602)

Otherwise if I register the locale, I get: Uncaught TypeError: de locale already registered. at Function.numeral.register (numeral.js:468)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8

github_iconTop GitHub Comments

8reactions
JonFranchicommented, Sep 6, 2019

Just ran into this issue two years later and it looks like the documentation is still not up to date to reflect the need to manually require or import the language file.

1reaction
JBoudMScommented, Sep 20, 2017

@tiesont Thank you very much for that. I still feel that the documentation needs an update, but this works much nicer. Is there a repo for the documentation?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't use specific Locales in Numberformat - Stack Overflow
I just want to use danish as the locale when getting a currency numberformat (where it says French now) but no locale "code"...
Read more >
2625983 - Locale ID cannot be used - SAP Support Portal
2625983 - Locale ID cannot be used · 1. Login in as system Admin > Go to References > Geography > Locales >...
Read more >
Fix Error - Locale: Cannot Set LC_ALL to default locale
In this guide let's discuss how to fix the error “locale: Cannot Set LC_ALL to default locale: No such file or directory” in...
Read more >
How do I fix my locale issue? - Ask Ubuntu
First run locale to list what locales currently defined for the current user account: $ locale LANG=C LANGUAGE= LC_CTYPE=fi_FI.
Read more >
cannot use LOCALE flag with a str pattern" in Python 3.6.0
Running behave features fails with "ValueError: cannot use LOCALE flag with a str pattern" in Python 3.6.0 · "/Applications/PyCharm 2016.3.app/Contents/helpers/ ...
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