Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Why globalize NuGet package does not include likelySubtags.json? #507
Hi @leniel, thanks for submitting this issue. Globalize itself doesn't include CLDR data. Please, read on https://github.com/jquery/globalize#where-does-the-data-come-from.
If you think there's anything we could do to make this information more clear, let me know and I'll be happy to reopen this issue.
Hi @rxaviers ... I tried to execute the command:
but it did not install... can you please tell me what's the problem by looking the the
It tells it can be an error with the package itself. I'm not sure.
By the way... I used the old jQuery Globalize and it was much simpler. Now with this new version things are a bit difficult to start. :)
If it helps you could take a look at my blog post that walks through the upgrade path from old Globalize to new Globalize. Best of luck!
referenced this issue
Sep 11, 2015
About your 1.x experience, can you give me a short description of your use case? Are you using it on a web application, or on backend on Node.js? If web application, do you use any tools to generate the final minified bundles for your application?
Well... I have an ASP.NET MVC 5 app using .NET Framework 4.6. I currently use NuGet as the package manager. I installed the Globalize Nuget package which pulled the cldr package as well as a dependency. That's fine but then I got the problem about it not finding the cldr-data
With ASP.NET MVC I'm using the default bundling that comes with it like this:
it takes care of minifying CSS and JS but again... I'm not sure how to get the cldr-data files and include in my project. It would be awesome if there was a NuGet package for that too. :)
That's why I tried to run the npm command but it failed.
I then tried with bower :) following the directions that @johnnyreilly gave in his great post. Guess what: it fails with:
Oh... I'm using Visual Studio 2015 which has built in support for NuGet, npm and bower.
The point is: I just wouldn't like to mix package managers... but if that's viable I'd try.
How do I get CLDR data? https://github.com/jquery/globalize/blob/master/doc/cldr.md
The thing about CLDR is that it's JSON data files. Globalize can interpret it during runtime, or you can precompile it all at build time and serve precompiled JS files (no JSON) via globalize-compiler. Globalize doesn't embed these JSON data within its modules because of two problems: (a) CLDR changes quickly than Globalize, so embedding would cause serving outdated content, (b) Globalize would embed a bunch of stuff you don't necessarily need in your app (it'd cause your app an awful load performance).
More about globalize-compiler can be found at:
What's my suggestion?
In your application, use Globalize as you don't need to load any CLDR. On development, let a helper tooling load the JSON for you dynamically. On production, let a helper tooling build the precompiled files, so you can bundle the smallest and fastest JS files in your produciton. Sounds crazy? It's exactly what this example do:
I am not going back to 0.1.3, but I think it would be helpful to have the CLDR json data available via CDN (github isn't one).
BTW I've just found cdnjs issue 10160 by Mottie, which addresses exactly the need to have CLDR available via a CDN.