Skip to content

Releases: elixir-cldr/cldr

Cldr version 2.47.0

08 Feb 21:59

Choose a tag to compare

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/0 to 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

21 Jan 19:52

Choose a tag to compare

Enhancements

  • Adds an exception Cldr.InvalidCurrencyCode to allow differentiation between invalid and unknown currency codes. This is primarily to support between currency validation in ex_money.

Cldr version 2.45.2

19 Jan 04:43

Choose a tag to compare

Changes

  • Changes the default locale match distance from 50 to 54. 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

17 Jan 19:48

Choose a tag to compare

Bug Fixes

  • Fix Cldr.Locale.cldr_locale_name/1 to pass through the backend to Cldr.Locale.Match.best_match/2.

Cldr version 2.45.0

17 Jan 11:48

Choose a tag to compare

Bug Fixes

  • Fix unsed require to 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/2 function. 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

13 Nov 05:53

Choose a tag to compare

Bug Fixes

  • Fix locale data format for locale display names for languages which have a :menu section.

  • Fix locale loading to atomize the keys for locale display for languages which have a :menu section.

Cldr version. 2.44.0

05 Nov 17:07

Choose a tag to compare

Breaking Changes

  • Some data formats have changed and the changes are reflected in the locale .json files. 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, 2 and -2 ordinal names are added to the data.
    • Locale display names and language names now have a subtype of menu which is a map containing the keys :core, :extension and :default. More or more of these entries may be nil.

Bug Fixes

  • Parsing language tags with the und (unknown) language now correctly substituted for a known language name if one can be found in Cldr.Locale.likely_subtags/0. For example:
iex> Cldr.validate_locale("und-TW")
{:ok, TestBackend.Cldr.Locale.new!("zh-Hant-TW")}
  • The :gettext_locale_name field of a t:Cldr.LanguageTag.t/0 is now set exactly as returned from Gettext.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/2 and Cldr.Locale.Match.match_distance/3 to 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 the gettext_locale_name field of a t:Cldr.LanguageTag.t/0 may change with this release.

Cldr version 2.43.2

13 Sep 11:47

Choose a tag to compare

Upgrading

  • Please note that when upgrading to ex_cldr version 2.43.0 and later it is also required to update the following dependent libraries:

    • ex_cldr_dates_times to at least version 2.23.0
    • ex_cldr_locale_display to 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 gettext requirement to allow the recently release 1.0 version. Thanks to @Terbium-135 for the report. Closes #262.

Cldr version 2.43.1

27 Aug 07:53

Choose a tag to compare

Bug Fixes

  • Fix Cldr.Locale.timezone_from_locale/1 when the territory has one zone and the zone short code is not instantiated as part of the language tag.

Cldr version 2.43.0

24 Aug 20:22

Choose a tag to compare

Deprecations

  • Deprecate Cldr.Timezone.fetch/1 in favor of Cldr.Timezone.fetch_short_zone/1

  • Deprecate Cldr.Timezone.get/1 in favor of Cldr.Timezone.get_short_zone/1

  • Deprecate Cldr.Timezone.timezones_for_territory/0 in favor of Cldr.Timezone.timezones_by_territory/0

  • Deprecate Cldr.Timezone.validate_timezone/1 in favor of Cldr.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 Cldr.Timezone.canonical_timezones/0 to return the mapping of IANA long timezone names to their canonical equivalent.

  • Adds Cldr.Timezone.canonical_timezone/1 to return the canonical timezone name for a given IANA long timezone name, or {:error, "Etc/Unknown"}.