Releases: elixir-cldr/cldr
Cldr version 2.47.0
Bug Fixes
-
Fixes adding of spurious base language locales. Thanks to @DaAnalyst for the report. Closes #270.
-
Fix calculating the fallback chain for a locale.
Enhancements
- Add
Cldr.Config.territory_codes/0to return a mapping from an ISO3166 alpha-2 code to the corresponding FIP, numerica and alpah-3 codes (where available).
Cldr version 2.46.0
Enhancements
- Adds an exception
Cldr.InvalidCurrencyCodeto allow differentiation between invalid and unknown currency codes. This is primarily to support between currency validation in ex_money.
Cldr version 2.45.2
Changes
- Changes the default locale match distance from
50to54. This means that a desired locale will match with a suported locale if the language matches - even if both the script and territory do not match. This matching algorithm is used when matching a requested locale to a known CLDR locale and a known Gettext locale. This change is very unlikely to affect the majority of users.
Cldr version 2.45.1
Bug Fixes
- Fix
Cldr.Locale.cldr_locale_name/1to pass through the backend toCldr.Locale.Match.best_match/2.
Cldr version 2.45.0
Bug Fixes
- Fix unsed
requireto remove warnings on Elixir 1.20.
Enhancements
-
Updates to CLDR 48.1 data.
-
Improves matching the desired locale name to an configured CLDR locale name by using
Cldr.Locale.Match.best_match/2function. This better formalises the matching process and is compliant with the CLDR locale matching specification. The matching process is slower than the previous mechanism but more accurate and compliant (there is room for future performance optimization). Configurations with a small number of locales should see no performance difference however raising an issue is encouraged if performance characteristics appear materially worse.
Cldr version 2.44.1
Bug Fixes
-
Fix locale data format for locale display names for languages which have a
:menusection. -
Fix locale loading to atomize the keys for locale display for languages which have a
:menusection.
Cldr version. 2.44.0
Breaking Changes
-
Some data formats have changed and the changes are reflected in the locale
.jsonfiles. These changes should not normally affect consumers since consumers are not normally expected to deal with the underlying data.- Relative ordinal date field localized names are now captured as a map not a list. In addition,
2and-2ordinal names are added to the data. - Locale display names and language names now have a subtype of
menuwhich is a map containing the keys:core,:extensionand:default. More or more of these entries may benil.
- Relative ordinal date field localized names are now captured as a map not a list. In addition,
Bug Fixes
- Parsing language tags with the
und(unknown) language now correctly substituted for a known language name if one can be found inCldr.Locale.likely_subtags/0. For example:
iex> Cldr.validate_locale("und-TW")
{:ok, TestBackend.Cldr.Locale.new!("zh-Hant-TW")}-
The
:gettext_locale_namefield of at:Cldr.LanguageTag.t/0is now set exactly as returned fromGettext.known_locale_names/1. Previously it was being tranformed to a BCP 47 format locale (replacing "_" with "-"). That is no longer the case. -
Territory containment was previously not considering nested containers and is now doing so. For example, territory "019" (Americas) includes "419" (Latin America and the Carribbean) but "419" was not appearing in the list for "019" since CLDR categorises "grouping" territories separately. This should not affect any consumers, only library writers.
Enhancements
-
Update to CLDR 48 data.
-
Add
Cldr.Locale.Match.best_match/2andCldr.Locale.Match.match_distance/3to implement the CLDR Language Matching algorithm. This is a more formal and testable approach that the previous mechanism. This new function will be use to implement better matching between a known CLDR locale name and supported Gettext locale names. Therefore it is possible that thegettext_locale_namefield of at:Cldr.LanguageTag.t/0may change with this release.
Cldr version 2.43.2
Upgrading
-
Please note that when upgrading to
ex_cldrversion 2.43.0 and later it is also required to update the following dependent libraries:ex_cldr_dates_timesto at least version 2.23.0ex_cldr_locale_displayto at least version 1.6.1
Bug Fixes
-
Fix Parsing a language tag when the U extension has a timezone short code that needs to be canonicalised. For example, "en-u-tz-est5edt" needs to become "en-u-tz-usnyc".
-
Relax
gettextrequirement to allow the recently release1.0version. Thanks to @Terbium-135 for the report. Closes #262.
Cldr version 2.43.1
Bug Fixes
- Fix
Cldr.Locale.timezone_from_locale/1when the territory has one zone and the zone short code is not instantiated as part of the language tag.
Cldr version 2.43.0
Deprecations
-
Deprecate
Cldr.Timezone.fetch/1in favor ofCldr.Timezone.fetch_short_zone/1 -
Deprecate
Cldr.Timezone.get/1in favor ofCldr.Timezone.get_short_zone/1 -
Deprecate
Cldr.Timezone.timezones_for_territory/0in favor ofCldr.Timezone.timezones_by_territory/0 -
Deprecate
Cldr.Timezone.validate_timezone/1in favor ofCldr.Timezone.validate_short_zone/1
Enhancements
-
Adds metazone, metazone mapping and primary zone data to the build process. This data supports timezone name localisation for a future release of ex_cldr_dates_times. See the github discussion for more background.
- Adds
Cldr.Config.metazones/0 - Adds
Cldr.Config.metazone_mapping/0 - Adds
Cldr.Config.metazone_ids/0 - Adds
Cldr.Config.primary_zones/0
- Adds
-
Adds
Cldr.Timezone.canonical_timezones/0to return the mapping of IANA long timezone names to their canonical equivalent. -
Adds
Cldr.Timezone.canonical_timezone/1to return the canonical timezone name for a given IANA long timezone name, or{:error, "Etc/Unknown"}.