You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Unicode Consortium's Common Locale Data Repository (CLDR) contains tons of high-quality locale data such as formatting rules for dates, times, numbers, currencies as well as language, country, calendar-specific names etc.
For localizing applications in Ruby we obviously want to use this incredibly comprehensive and well-maintained resource.
By default, the thor cldr:export command will export all known components from all locales to the target directory:
thor cldr:export
Locales, components, and target directory
You can also optionally specify locales and/or components to export as well as the target directory:
# Export the `Numbers` and `Plurals` components for the locales `de`, `fr-FR` and `en-ZA` to the `./data` target directory
thor cldr:export --locales de fr-FR en-ZA --components Numbers Plurals --target=./data
Draft status
CLDR defines a hierarchy of four draft statuses, used to indicate how confident they are in the data: unconfirmed < provisional < contributed < approved.
By default, ruby-cldr only exports data with a minimum draft status of contributed (i.e., contributed or approved). This is the same threshold that is used by the Unicode Consortium's International Components for Unicode (ICU).
Set the --draft-status= parameter to specify the minimum draft status the data needs in order to be exported:
# Export any data with a minimum draft status of `provisional`# (i.e., `provisional`, `contributed` or `approved`)).
thor cldr:export --draft-status=provisional