Ex_Cldr v2.23.0 Release Notes
-
๐ This is the changelog for Cldr v2.23.0 released on July 1st, 2021. For older changelogs please consult the release tag on GitHub
๐ Bug Fixes
๐ Corrects the formation of a canonical language tag. In previous releases, the script tag was always included as part of the canonical locale name. For example,
en-US
would becomeen-Latn-US
becauseLatn
is defined as a likely subtag ofen
. However TR35 specifies that if the script is the only script specified for this language then it should be omitted from the canonical name. Fixing this conformance is also a prerequisite for generating local display names.Fixes
Cldr.Locale.normalize_locale_name/1
to correctly case all keys in lower case except script (capital case) and region (upper case). It will now also process arbitrary locale names.0๏ธโฃ A language tag can have more than one variant and this was not correctly implemented. As a result, the
t:Cldr.LanguageTag
struct fieldvariant
is renamedvariants
and is now a list with a default of[]
rather thannil
.Fix a race condition which could return incorrect results for a backend
known_gettext_locale_names/0
Cldr.validate_locale/2
will now return an error if the territory for a locale is unknown to CLDR. Note thatCldr.Locale.new/1,2
checks only if the territory is valid - not if it is known to CLDR.Locale inheritance no longer includes the "root" locale. In alignment with BCP 47, the "root" locale is now longer a valid locale. Parsing a locale name "root" is still valid but it will return the "und" language instead. While parsing is still correct, it remains a locale that is not valid for use in
ex_cldr
. The "root" locale is used only for a limited set of rules-based number formats.Correct territory containment chain for the territory
US
.๐ Correctly parses and validates the -t- extension of a language tag.
๐ Fixes inspecting a language tag that has a
-t-
extension and/or a private use (-x-
) extension.
โจ Enhancements
โ Add
Cldr.DisplayName
protocol definition to return a localised string representation of CLDR-based structs such ast:Cldr.LanguageTag
,t:Cldr.Unit
andt:Cldr.Currency
Cldr.Locale.new/1,2
now passes all ~1600 validation tests for parsing and forming the canonical locale name. This is a prerequisite to implementing the Locale Display Algorithm in ex_cldr_locale_display.Cldr.locale_and_backend_from/1
now supports amap
of options as the argument.Cldr.validate_territory/1
now correctly substitutes for known aliases. For exampleMyApp.Cldr.validate_locale("en-UK")
will correctly returnen-GB
.๐ Implement the
String.Chars
protocol to supportKernel.to_string/1
fort:Cldr.LanguageTag
structs.๐ Implement the
Inspect
protocol to supportinspect/2
fort:Cldr.LanguageTag
structs.โ Add
Cldr.LanguageTag.sigil_l/2
to simplify creatingt:Cldr.LanguageTag
structs.โ Add
Cldr.validate_script/1
to normalize and validate a script code (which is now in atom format as its canonical form)๐ Pre-compiled language tags (which are stored in
priv/cldr/language_tags.ebin
) are now cached during compilation resulting in a minor performance improvement in compile times.๐ Pre-generate the rfc5646 parser which improves overall compile times. As a result the
nimble_parsec
dependency is marked asoptional
since it is no long required by library consumers.