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 become en-Latn-US because Latn is 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.

    • 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 field variant is renamed variants and is now a list with a default of [] rather than nil.

    • 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 that Cldr.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 as t:Cldr.LanguageTag, t:Cldr.Unit and t:Cldr.Currency

    • Cldr.Locale.new/1,2 now 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/1 now supports a map of options as the argument.

    • Cldr.validate_territory/1 now correctly substitutes for known aliases. For example MyApp.Cldr.validate_locale("en-UK") will correctly return en-GB.

    • ๐Ÿ‘ Implement the String.Chars protocol to support Kernel.to_string/1 for t:Cldr.LanguageTag structs.

    • ๐Ÿ‘ Implement the Inspect protocol to support inspect/2 for t:Cldr.LanguageTag structs.

    • โž• Add Cldr.LanguageTag.sigil_l/2 to simplify creating t: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 as optional since it is no long required by library consumers.