cldrjs icon indicating copy to clipboard operation
cldrjs copied to clipboard

How to get CLDR data? Needs more detailed information.

Open DianaLaa opened this issue 7 years ago • 6 comments

In my quest to resolve

E_MISSING_CLDR: Missing required CLDR content 'supplemental/likelySubtags'.

I've stumbled across various questions that ask the same thing. None of the answers seems exhaustive. Sorry to open yet another topic, but I think it's needed to have a basic tutorial.

I want two switch between formatting numbers in "en-US" and "nl-NL". So I need both languages configured.

I have found https://github.com/unicode-cldr/cldr-json.

  1. What do I download? Is cldr-core and cldr-numbers enough?
  2. Which version do I get? cldrjs NuGet package is version 0.4.8, but clrd-json has latest version 31.0.1. Does that work together?
  3. Where do I put it, in my project folder structure?
  4. Exactly what JavaScript do I write to bootstrap this in each language?

DianaLaa avatar Sep 21 '17 16:09 DianaLaa

Did you decide it?

samambetov avatar Jan 21 '18 09:01 samambetov

Got the same issue but I found this

hakrac avatar Aug 17 '18 16:08 hakrac

Yes, the documentation is ambiguous and incomplete to say the least.

yrammos avatar Nov 18 '19 13:11 yrammos

Cldr.js itself requires supplemental/likelySubtags, everything else is optional. It actually depends on the library that uses cldr.js to implement i18n. For example, globalize.js (that uses cldr.js under the hoods) depends on the following for each of its functionalities https://github.com/globalizejs/globalize/#2-cldr-content

I am happy to accept PRs that clarifies the documentation here. Thank you

rxaviers avatar Nov 18 '19 14:11 rxaviers

Thanks, @rxaviers. I realize now that my earlier comment read unnecessarily curt — my apologies.

yrammos avatar Nov 19 '19 09:11 yrammos

I am keeping getting this: globalize.min.js:1 Uncaught Error: E_MISSING_CLDR: Missing required CLDR content supplemental/likelySubtags. at u (globalize.min.js:1) at f (globalize.min.js:1) at e.n (globalize.min.js:1) at e.t.emitEvent (event.min.js:1) at e.trigger (event.min.js:1) at S.e.get (event.min.js:1) at p (globalize.min.js:1) at Function.g.locale (globalize.min.js:1) at utilities.js:847

Here is what I load:

<script src="https://cdnjs.cloudflare.com/ajax/libs/cldrjs/0.5.1/cldr.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cldrjs/0.5.1/cldr/event.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cldrjs/0.5.1/cldr/supplemental.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/globalize/1.5.0/globalize.min.js" type="text/javascript"></script>

Any idea what's going on?

Thanks

markzolotoy avatar Apr 16 '20 19:04 markzolotoy