Releases: elixir-cldr/cldr
Cldr version 2.27.1
Cldr version 2.27.0
Bug Fixes
- Remove spurious
Cldr.Trans
module. The new ex_cldr_trans provides this capability.
Enhancements
-
Add
:host
to the list of places thatCldr.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 haveCldr.is_locale_name/1
that permits atoms and strings since it is used to guard functions that might useCldr.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
Cldr version 2.26.2
Bug Fixes
- Fix
Cldr.Locale.canonical_language_tag/3
for cases when the:add_likely_subtags
isfalse
and the locale name isknown
.
Cldr version 2.26.1
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
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-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.
Cldr version 2.25.0
Bug Fixes
- Fixes configuring locales when the default locale is in posix form (ie like
en_GB
) as apposed to BCP47 form (ieen-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
- Implement
Cldr.Gettext.Plural
allowing the creation of gettext plural forms modules.
Cldr version 2.24.2
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
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
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 supportex_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 ofCldr.Locale.Loader.known_locale_names/1
. -
Deprecated
Cldr.Config.known_rbnf_locale_names/1
in favour ofCldr.Locale.Loader.known_rbnf_locale_names/1
. -
Deprecated
Cldr.Config.get_locale/2
in favour ofCldr.Locale.Loader.get_locale/2
. -
Deprecated the
:put_session?
option inCldr.Plug.SetLocale
. Use the plugCldr.Plug.PutSession
instead.