Closed rxaviers closed 10 years ago
How does an author provide a library that uses the full data set without requiring the consumer to pass the environment variable when installing?
Hi @mlmorg, CLDR data can be thought of being sliced into two orthogonal dimensions: functionality (numbers, dates, ...) and locale coverage (tier-1 < all). Any locale coverage (e.g., tier-1) is complete on regard of its functionality (has numbers, dates, ...).
Usually (considering the use cases I've experienced), libraries define its functionality needs (number formatters need number data). But, locale coverage is a decision left to applications. Application A using your library may need en-US only. But, application B may need the whole available locale coverage. Therefore, the design approach taken here was to let applications to define its locale coverage needs (not the library). Anyway, If you could share a little more details of what you need, I could be able to help. Why does your library require the full locale coverage (instead of requiring functionality slices)?
That's a good point that I didn't think of. My use-case was to provide a library with the translated names of all languages. I always wanted to have the full set so it was standardized across projects; but, you're correct, in that then that is determining locale coverage instead of functionality.
Do you deduce that information from CLDR or do you maintain the content?
All the applications will use the same set of locales, which is specified and stored in a completely separate service that would necessitate the use of the full CLDR set. So, I was simply going to provide the full set by default for all applications instead of still giving them the option of deciding for themselves... but I agree with your caveat so will probably rearchitect that.
Cool. Just let me know if you need anything from cldr-data.
cldr-data-full
has been deprecated in favor of this module (cldr-data
) + the use of environment variables to set its "coverage behavior".The default is to install the JSON from
http://www.unicode.org/Public/cldr/<version>/json.zip
.In order to install the full JSON
http://www.unicode.org/Public/cldr/<version>/json-full.zip
, use:In order to pass a different url host and path, use: