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,
Latnis defined as a likely subtag of
en. 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.
Cldr.Locale.normalize_locale_name/1to 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
variantsand is now a list with a default of
Fix a race condition which could return incorrect results for a backend
Cldr.validate_locale/2will now return an error if the territory for a locale is unknown to CLDR. Note that
Cldr.Locale.new/1,2checks 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
📜 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 (
Cldr.DisplayNameprotocol definition to return a localised string representation of CLDR-based structs such as
Cldr.Locale.new/1,2now passes all ~1600 validation tests for parsing and forming the canonical locale name. This is a prerequsite to impementing the Locale Display Algorithm in ex_cldr_locale_display.
Cldr.locale_and_backend_from/1now supports a
mapof options as the argument.
Cldr.validate_territory/1now correctly substitutes for known aliases. For example
MyApp.Cldr.validate_locale("en-UK")will correctly return
👍 Implement the
String.Charsprotocol to support
👍 Implement the
Inspectprotocol to support
Cldr.LanguageTag.sigil_l/2to simplify creating
Cldr.validate_script/1to 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_parsecdependency is marked as
optionalsince it is no long required by library consumers.