Elixir implementation of CLDR/ICU
Fix warnings on Elixir 1.17. This primarily relates to charlists constants now required to use sigil_c
to avoid warnings. As a result, tests will only work on Elixir 1.16 and later even though support for the library is for Elixir 1.11 and later.
Make Cldr.Config.cldr_data_dir/0
a runtime result, not a compile time result.
Sort currency data in Cldr.Config.territories/0
so ensure deterministic order. Closes #227.
This is the changelog for Cldr v2.38.0 released on April 21st, 2024. For older changelogs please consult the release tag on GitHub
Update to CLDR 45.0 data.
Adds Cldr.validate_locale!/2
. Thanks to @jarrodmoldrich for the suggestion.
Add decimal separator and grouping separator to the currency data for each locale. In some rare cases, like the currency [CVE](https://en.wikipedia.org/wiki/Cape_Verdean_escudo#:~:text=The%20escudo%20(sign%3A%20%3B%20ISO,subdivided%20into%20one%20hundred%20centavos.) in the locale pt-CV the currency symbol is placed where decimal separator is normally placed. The same can apply for the grouping separator although it appears not locale uses this field.
Adjust the Inspect
protocol implementation for t:Cldr.LanguageTag.t/0
types. When the language tag is resolved to a CLDR locale then the output is executable code. For example:
iex> MyApp.Cldr.Locale.new!("en-US")
MyApp.Cldr.Locale.new!("en-US")
Fix dialyzer warnings. Thanks to @Munksgaard for the PR. Closes #220. Also fixes :underspecs
warning and the :underspecs
dialyzer flag is now configured.
Add configuration for the new ex_cldr_person_names backend module generator.
ex_cldr_territories
. The change, which normalizes subdivision codes to be upcase atoms when the subdivision has its own ISO 3166 territory code, will be be added back for ex_cldr
version 2.38.0 which will align with CLDR 44. Closes #216.:json_library
in config.exs
and checking for Phoenix configuration can cause config failures when building in Docker. Thanks to @maciej-szlosarczyk for the report. Closes #208.:und
in the list returned by Cldr.known_locale_names/1
since that function is commonly used to enumerate the configured locales and ultimately used to generate UI elements. :und
is not a useful locale to select so its inclusion, which was added in ex_cldr version 2.37.0
is inappropriate and now reverted.Cldr.Locale.parent/1
to use :und
as the ultimate parent rather than the default locale. This brings closer conformance to the CLDR specification.Upgrade to CLDR 43 data.
Locale data is now versioned. If a locale file is found but if has no version (data prior to this release) or a version that does not match, the appropriate locale file is downloaded. This ensures locale files and ex_cldr
are kept in sync. Closes #188.
Changes Cldr.version/0
to return the version of CLDR data as a t:Version.t/0
. This is then used to check the version of the locale data and forcing a download if the locale data is out of date for this release of ex_cldr
.
Adds Cldr.Locale.script_direction_from_locale/1
and MyApp.Cldr.Locale.script_direction_from_locale/1
to return :ltr
(for left-to-right scripts) or :rtl
(for right-to-left scripts). Closes #196. Thanks to @Doerge for the suggestion.
Adds Cldr.Validity.Script.unicode_script_to_subtag/1
as public, undocumented function. This function is required by ex_cldr_person_names
and may be documented in a future release. It maps between a unicode script name (like that returned by Unicode.script/1
in the unicode
library) to the appropriate subtag used by CLDR.
Unit data is now kept as Decimal not Ratio so :ratio
is no longer a dependency here, or in ex_cldr_units
.
Note that ex_cldr
version 2.36.0 data for interval formats is keyed differently than that of previous releases. The bug fix noted below means that this version of ex_cldr
is only compatible with ex_cldr_dates_times
version 2.13.3
and later. Only ex_cldr_dates_times
is affected, other ex_cldr
libraries are insensitive to this change.
Fixes the date time interval format keys. In previous releases, the locale ingestion process would treat keys like :Hm
as being the same as :hm
and as a result only the lower case version would be saved. This means that locales that rely upon 0..23
or 1..24
hour formats could not be formatted correctly.
Fixes the mix cldr.download.iso_currency
to use the Cldr.Http.get/2
function to download the data. Doing so ensures that peer verification happens and no error log message is emitted.