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 inconfig.exs
. Note that on Windows eithercastore
,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 inconfig.exs
in keeping with modern Elixir app configuration strategies.Adds the
Cldr.Chars
protocol and theCldr.to_string/1
function intended to be a drop-in replacement forKernel.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
andCldr.Plug.SetLocale
no longer require a backend be configured. TheCldr.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 BCP47U
extension. This changes the data format of aLanguageTag
that has aU
extension. Additionally, most fields of this struct are now atoms, not binaries.โ Adds
Cldr.LanguageTag.T
to formalise the structure of the BCP47T
extension. This changes the data format of aLanguageTag
that has aT
extension.๐ Rename
Cldr.Config.calendar_data/0
toCldr.Config.calendars/0
๐ Rename
Cldr.Config.territory_info/0
toCldr.Config.territories/0
๐ Rename
Cldr.Config.territory_info/1
toCldr.Config.territory/1
๐ Rename
Cldr.Config.week_data/0
toCldr.Config.weeks/0
Rename
Cldr.Config.territory_containment/0
toCldr.Config.territory_containers/0
Remove
priv/cldr/measurement_system_preferences.json
. This data is returned inCldr.Config.territories/0
Use canonical measurement system names throughout. This changes some data returned by
Cldr.Config.territory/0
andCldr.Config.measurement_system_preferences/0
๐ Rename
priv/cldr/week_data.json
topriv/cldr/weeks.json
๐ Rename
priv/cldr/calendar_data.json
topriv/cldr/calendars.json
๐ Rename
priv/cldr/territory_info.json
topriv/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 definesto_string/1
and it invoked fromCldr.to_string/1
. It is intended as a drop-in replacement forKernel.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 byCldr.default_backend/0
will be used by default.๐ง The plug
Cldr.Plug.SetLocale
no longer requires that a backend be configured. The backend returned byCldr.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 theCldr.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.0Unit 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 moduleAdd
Cldr.validate_measurement_system/1
to validate a measurement system nameโ Add
Cldr.Config.measurement_systems/0
to return a map of known measurement systemsAdd
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 version2.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 childrenAdd
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 includesuse 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