Closed ryall closed 2 years ago
These properties are not available via the public api, but they are accessible via the Schema
which provides a type-safe accessor to all values in the resource pack. This is used by the library internally to fetch the various strings, formats, and number parameters.
Here's a quick sandbox example of fetching the number params for the Latin number system ("latn"
). Click "English" or "German" buttons, or enter a language tag, to see the parameters for that locale. The code for accessing the params is between the =====
comments. https://codesandbox.io/s/phensley-cldr-usage-example-forked-03qci
If you aren't using this library in your app you could use this code to extract the separators you need ahead of time and create lightweight mapping of locale -> separators
JS/JSON.
Fantastic, thanks so much. Really loving this library so far! Kudos for all the hard work!
I need them to pass to a currency input, so that I can match the input format to the locale. I've had a look but the data format is quite complex, so though I would ask if/how I would go about retrieving this data for a specific locale?