Ex_Cldr v2.14.0 Release Notes

Release Date: 2020-05-12 // almost 4 years ago
  • ๐Ÿš€ This is the changelog for Cldr v2.14.0 released on May 2nd, 2020. For older changelogs please consult the release tag on GitHub

    ๐Ÿš€ The primary purpose of this release is to support the new data for units that standardize a means for conversion. In addition, some data file names are changed to be more consistent in naming.

    Summary

    • ๐Ÿš€ Updates the data source to CLDR release 37.

    • ๐Ÿ Require that a certificate trust store be configured in order to download locales. A system trust store will be automatically detected in many situations. In other cases configuring castore or certifi will be automatically detected. A specific trust store can be configured under the :cacertfile key of the :ex_cldr configuration in config.exs. Note that on Windows either castore, certifi or a configured trust store will be requried.

    • 0๏ธโƒฃ Add Cldr.put_default_locale/{1, 2} to set the system-wide default locale. The removes the need to configure a default locale in config.exs in keeping with modern Elixir app configuration strategies.

    • Adds the Cldr.Chars protocol and the Cldr.to_string/1 function intended to be a drop-in replacement for Kernel.to_string/1 to make it easier to develop localised applications.

    • Add the new data Units introduced in CLDR version 37. This data is used in an updated ex_cldr_units package.

    • ๐Ÿ”ง The plugs Cldr.Plug.AcceptLanguage and Cldr.Plug.SetLocale no longer require a backend be configured. The Cldr.default_backend/0 will be used if no specific backend is configured.

    • โž• Add territory subdivisions. The are a geographic level below territory and typically represent states/provinces of a country. In some cases large cities or counties are also known.

    • โž• Add calendar preferences. Cldr.Config.calendar_preferences/0 returns the map of territory to the desired calendar list in descending order or preference.

    • โž• Add "yue" locale now that the data is complete in CLDR 37. There are now 566 locales up from 541 in CLDR 36. See the release notes for further information.

    ๐Ÿ’ฅ Breaking changes (that you should not notice)

    Although these are breaking changes, they are changes that affect functions in Cldr.Config which is considered a private module and therefore client applications are not expected to be impacted.

    • ๐Ÿ‘ Minimal supported version of Elixir is 1.6 (it was 1.5)

    • โž• Adds Cldr.LanguageTag.U to formalise the structure of the BCP47 U extension. This changes the data format of a LanguageTag that has a U extension. Additionally, most fields of this struct are now atoms, not binaries.

    • โž• Adds Cldr.LanguageTag.T to formalise the structure of the BCP47 T extension. This changes the data format of a LanguageTag that has a T extension.

    • ๐Ÿ“‡ Rename Cldr.Config.calendar_data/0 to Cldr.Config.calendars/0

    • ๐Ÿ“‡ Rename Cldr.Config.territory_info/0 to Cldr.Config.territories/0

    • ๐Ÿ“‡ Rename Cldr.Config.territory_info/1 to Cldr.Config.territory/1

    • ๐Ÿ“‡ Rename Cldr.Config.week_data/0 to Cldr.Config.weeks/0

    • Rename Cldr.Config.territory_containment/0 to Cldr.Config.territory_containers/0

    • Remove priv/cldr/measurement_system_preferences.json. This data is returned in Cldr.Config.territories/0

    • Use canonical measurement system names throughout. This changes some data returned by Cldr.Config.territory/0 and Cldr.Config.measurement_system_preferences/0

    • ๐Ÿ“‡ Rename priv/cldr/week_data.json to priv/cldr/weeks.json

    • ๐Ÿ“‡ Rename priv/cldr/calendar_data.json to priv/cldr/calendars.json

    • ๐Ÿ“‡ Rename priv/cldr/territory_info.json to priv/cldr/territories.json

    ๐Ÿ› Bug Fixes

    • Correct the preferred measurement system for temperature in some territories (including the US)

    โœจ Enhancements

    • ๐Ÿ”ง Require that a certificate trust store be configured in order to download locales

    • Add the Cldr.Chars protocol which defines to_string/1 and it invoked from Cldr.to_string/1. It is intended as a drop-in replacement for Kernel.to_string/1 excepting that it produces localised output. Then intent is to continue making it easier for developers to build localised applications.

    • ๐Ÿ”ง The plug Cldr.Plug.AcceptLanguage no longer requires that a backend be configured. The backend returned by Cldr.default_backend/0 will be used by default.

    • ๐Ÿ”ง The plug Cldr.Plug.SetLocale no longer requires that a backend be configured. The backend returned by Cldr.default_backend/0 will be used by default.

    • ๐Ÿ“œ t:Cldr.LanguageTag.t now includes a :backend field which is populated during parsing. This allows the implementation of the Cldr.Chars protocol.

    • CLDR has introduced unit conversion data. This data is now packaged as Cldr.Config.units/0 which is used for ex_cldr_units version 3.0

    • Unit Preferences now consistently use underscore in names and values instead of dashes.

    • โž• Add Cldr.validate_backend/1 to validate if a module is a CLDR backend module

    • Add Cldr.validate_measurement_system/1 to validate a measurement system name

    • โž• Add Cldr.Config.measurement_systems/0 to return a map of known measurement systems

    • Add Cldr.Config.time_preferences/0 to return a map of time preferences for a given locale or territory. This data is used in ex_cldr_dates_times from version 2.4

    • โž• Add Cldr.Config.territory_containment/0 that returns a map of territories to a list of lists of the territories in which it is contained. A territory may be contained by more than one list of containers. For example, :GB is contained like this: [[:"154", :"150", :"001"], [:UN], [:EU]].

    • Add Cldr.known_territory_subdivisons/0 to return a map of regions and subdivisions and their children

    • Add Cldr.known_territory_subdivision_containment/0 to return a map of subdivisions and their parents

    • โž• Add priv/cldr/units.json which contains the new unit data and conversion information from CLDR 37

    • โž• Add priv/cldr/measurement_systems.json

    • โž• Add Cldr.validate_backend/1 to confirm a backend modules existence and that it includes use Cldr

    • Add Cldr.Locale.territory_from_locale/1 to determine the territory to be used for localization.

    • โž• Add Cldr.Config.calendar_preferences/0

    • โž• Add Cldr.the_world/0 that returns the territory code for the world which is :001