Skip to content

Releases: elixir-cldr/cldr

Cldr version 2.27.1

08 Mar 10:17
Compare
Choose a tag to compare

Bug Fixes

  • Don't depend on CLDR product data being available at compile time. Eggregious error inserted in release 2.27.0. Thanks to @dkln for the report. Closes #170.

Cldr version 2.27.0

07 Mar 22:52
Compare
Choose a tag to compare

Bug Fixes

  • Remove spurious Cldr.Trans module. The new ex_cldr_trans provides this capability.

Enhancements

  • Add :host to the list of places that Cldr.Plug.SetLocale can look for to derive a locale for a request.

  • Add Cldr.Locale.fallback_locale_names!/1 to return the locale fallback chain or raise an execption.

  • Add Cldr.with_locale/2 to execute a function with the process locale set to a given locale. The current locale is put back in place after the function executes.

  • Add Cldr.Locale.is_locale_name/1 guard. This is an area that needs some cleanup since we have

    • Cldr.is_locale_name/1 that permits atoms and strings since it is used to guard functions that might use Cldr.validate_locale/2. Therefore this is most useful for functions that take user input.
    • Cldr.Locale.is_locale_name/1 that permits only atom locale names since this the canonical form.

Cldr version 2.26.3

24 Feb 13:22
Compare
Choose a tag to compare

Bug Fixes

  • Fix spec of Cldr.put_locale/2. Thanks to @alappe for the report. Closes #167.

Cldr version 2.26.2

22 Feb 15:09
Compare
Choose a tag to compare

Bug Fixes

  • Fix Cldr.Locale.canonical_language_tag/3 for cases when the :add_likely_subtags is false and the locale name is known.

Cldr version 2.26.1

20 Feb 23:57
Compare
Choose a tag to compare

Bug Fixes

  • Fix Cldr.locale_and_backend_from/2 for atom locales. Since this is a private API there should be no upstream issues with dependent libraries.

Cldr version 2.26.0

20 Feb 22:28
Compare
Choose a tag to compare

LanguageTag structure changes

  • Cldr.LanguageTag.t has been revised with the :cldr_locale_name and :rbnf_locale_name now being atoms rather than binaries. This is unlikely to affect client code. The primary benefit, apart from a slightly improve

Bug Fixes

  • Fix setting the default backend with Cldr.put_default_backend/1 which wasn't actually being set.

  • Fix Config.message_formats to default to an empty map, not an empty list.

  • Fix Cldr.Locale.parents/1 to return an {:ok, list} tuple on success rather than a bare list.

  • Fix <backend>.Cldr.Number.{Cardinal, Ordinal, Spellout}.pluralize/3 for non-integer Decimal numbers.

Enhancements

  • Add <backend>.Trans module to support closer integration with the trans for database translations.

  • Add Cldr.Locale.fallback_locales/1 to return the list of recursively created parent locales, including the provided locale. This can be used to support resolving translations from a system that might be sparsely populated.

  • Add Cldr.Locale.fallback_locale_names/1 that returns the :cldr_locale_name component of the locales returned by Cldr.Locale.fallback_locales/1.

  • Adds Cldr.Locale.locale_from_territory/{1,2} to derive a "best fit" locale for a given territory. Also adds <backend>.Locale.locale_from_territory/1.

  • Adds Cldr.Locale.locale_from_host/{2, 3} to derive a "best fit" locale for a given host name. Also adds <backend>.Locale.locale_from_host/2.

  • Adds Cldr.Locale.territory_from_host/1 to return the territory for a given host name. Also adds <backend>.Locale.territory_from_host/1.

  • Adds Cldr.Locale.consider_as_tlds/0 to return a list of valid territory suffixes that are considered as generic TLDs instead. See https://developers.google.com/search/docs/advanced/crawling/managing-multi-regional-sites.

  • Adds Cldr.Locale.languages_for_territories/0 to return a mapping of territories to that territory's most spoken language.

  • Adds Cldr.put_gettext_locale/1 that sets the gettext locale for a given t:Cldr.LanguageTag.

  • Adds Cldr.TestHelper module in test/suport to provide testing helpers. Initially provides with_no_default_backend/1 function.

Cldr version 2.25.0

15 Dec 19:39
Compare
Choose a tag to compare

Bug Fixes

  • Fixes configuring locales when the default locale is in posix form (ie like en_GB) as apposed to BCP47 form (ie en-GB). In fixing this bug, forming the normalised list of configured locales is now also standarised. Thanks to @gazzer82 for the report. Closes #165

Enhancements

Cldr version 2.24.2

05 Dec 19:17
Compare
Choose a tag to compare

Bug Fixes

  • Obviate compiler warning for Code.can_await_module_compilation?/0 on Elixir versions where the function does not exist. Thanks to @DaTrader for the report.

Enhancements

  • Apply @external_resource for each configured locale in backend modules.

Cldr version 2.24.1

01 Nov 10:18
Compare
Choose a tag to compare

Bug Fixes

  • Fix compilation performance regression when compiling ex_cldr on Elixir 1.13 and later. ex_cldr has relied upon a private API in Elixir to detect when compilation is in progress and to then cache locale files. This improves compilation performance when many locales are configured by up to 6x. However the private API has changed in Elixir 1.13 and there is now a public API as well (hooray!). Thanks very much to @josevalim for the support as always, and for the PR that fixed the issue.

Cldr version 2.24.0

27 Oct 23:43
Compare
Choose a tag to compare

Enhancements

  • Updated to CLDR 40 data. In addition, the canonical format of some data has changed; for example subdivisions are now atoms, not strings. This change is primarily of interest to authors writing libraries that use the raw underlying locale data.

Bug Fixes

  • Fixes an issue with the locale loader which was incorrectly atomizing date part keys in date/time formats and conversly incorrectly stringifying the number system in the same formats.

  • Cldr.validate_territory_subdivision/1 was case sensitive and didn't correctly handle atoms and binaries. Required to support ex_cldr_territories properly.

  • Correctly atomize the keys for the locale display names "language" types.

  • Cldr.Plug.PutSession now uses the locale key :canonical_locale_name to serialize to the session. Previously it was using :cldr_locale_name which does not include any of the extension information. Extension information encodes user preferences and is required to properly support localisation.

  • Cldr.known_territories/1 no longer includes reserved, deprecated, special use or private use territory codes.

Deprecations

  • Deprecated Cldr.Config.known_locale_names/1 in favour of Cldr.Locale.Loader.known_locale_names/1.

  • Deprecated Cldr.Config.known_rbnf_locale_names/1 in favour of Cldr.Locale.Loader.known_rbnf_locale_names/1.

  • Deprecated Cldr.Config.get_locale/2 in favour of Cldr.Locale.Loader.get_locale/2.

  • Deprecated the :put_session? option in Cldr.Plug.SetLocale. Use the plug Cldr.Plug.PutSession instead.