Ex_Cldr v2.26.0 Release Notes
-
๐ This is the changelog for Cldr v2.26.0 released on February 21st, 2022. For older changelogs please consult the release tag on GitHub
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 improved memory space, is the easier integration planned with the trans library.
๐ Bug Fixes
0๏ธโฃ 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-integerDecimal
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 byCldr.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 thegettext
locale for a givent:Cldr.LanguageTag
.Adds
Cldr.TestHelper
module intest/suport
to provide testing helpers. Initially provideswith_no_default_backend/1
function.