Changelog History
Page 2
-
v3.5.2 Changes
๐ This is the changelog for Cldr_units v3.5.2 released on April 12th, 2021. For older changelogs please consult the release tag on GitHub
๐ Bug Fixes
- ๐ Fix getting a unit pattern when the unit value is zero, one or two and there is no pattern for the default unit plural category. Thanks to @syfgkjasdkn for the report. Closes #21.
-
v3.5.1 Changes
๐ This is the changelog for Cldr_units v3.5.1 released on April 11th, 2021. For older changelogs please consult the release tag on GitHub
๐ Bug Fixes
- ๐ Use
:other
plural category to format units which have a value of 0, 1 or 2 when the natural unit pattern has no substitutions. This corrects the situation in locales such ashe
andar
where the unit pattern for plural category:one
has no substitutions. Previously this would means the formatted string for a unit with a vaue of1
and-1
would both output the same string. Thanks to @jarrodmoldrich for the report and to @voltone for his family's help with hebrew grammar.
- ๐ Use
-
v3.5.0 Changes
๐ This is the changelog for Cldr_units v3.5.0 released on April 8th, 2021. For older changelogs please consult the release tag on GitHub
Overview
๐ In this release the
Cldr.Unit.to_string/{1, 2, 3}
function has been rewritten and the concrete impementation is now inCldr.Unit.Format
. The primary reasons for rewriting are:๐ 1. Improves performance by 20% over the old implementation. ๐ 2. Supports grammatical case and grammatical gender. These allow for better sentence formation in a localised fashion. Only are few locales have the required data for now (for example,
fr
andde
) however more locales will have data in upcoming CLDR releases.โ Note that full testing of grammatical case and grammatical gender variations is not yet complete.
๐ Soft Deprecation
๐ The function
Cldr.Unit.to_iolist/{1, 2, 3}
is soft deprecated. It is still available and no deprecation warning is emitted. It will however be removed from the public API in a future release. This function is primarily used to support implementation ofCldr.Unit.to_string/3
As of this release, argument checking in
Cldr.Unit.to_iolist/3
is less rigorous in order to avoid the relatively expensive argument normalization process happening twice (once inCldr.Unit.to_string/3
and then again inCldr.Unit.to_iolist/3
).
๐ Bug Fixes
The new string formatter correctly assembles units with an SI prefix (ie
millimeter
) in languages such as German where the noun is capitalized.๐ Fixes calculating the base unit when the unit is a complex compound unit.
โ Remove double parsing when calling
Cldr.Unit.new/2
and the unit is not inCldr.Unit.known_units/0
Ensure
Cldr.Unit.unit_category/1
returns an error tuple if the category is unknown
โจ Enhancements
๐ฆ Updated to require ex_cldr version 2.20 which includes CLDR 39 data.
Add
Cldr.Unit.validate_grammatical_gender/2
Add
Cldr.Unit.known_grammatical_cases/0
Add
Cldr.Unit.known_grammatical_genders/0
Add
Cldr.Unit.known_measurement_system_names/0
โ Add
Cldr.Unit.invert/1
to invert a "per" unit. This allows for increased compatibility for conversions. For example, "liters per 100 kilometers" is a measure of consumption, as is "miles per gallon". However these two units are not convertible without inverting one of them first since one is "volume per length" and the other is "length per volume".โ Add
Cldr.Unit.conversion_for/2
to return a conversion list used when converting one unit to another.โ Add
Cldr.Unit.grammatical_gender/2
to return the grammatical gender for a given unit and localeโ Add
Cldr.Unit.conversion_for/2
to return a conversion list used when converting one unit to another.Add support for grammatical cases for
Cldr.Unit.to_string/2
andCldr.Unit.to_iolist/2
. Not all locales support more than the nominative case. The nominative case is the default. Any configured "Additional Units" in a backend module will need to be modified to put the localisations a map with the key:nominative
. See the readme for more information on migrating additional units. On example is:defmodule MyApp.Cldr do use Cldr.Unit.Additional
use Cldr, locales: ["en", "fr", "de", "bs", "af", "af-NA", "se-SE"], default_locale: "en", providers: [Cldr.Number, Cldr.Unit, Cldr.List]
unit_localization(:person, "en", :long, nominative: %{ one: "{0} person", other: "{0} people" }, display_name: "people" ) end
* ๐ Support conversions where one of the base units is the inverted conversion of the other. This allows conversion between, for example, `mile per gallon` and `liter per 100 kilometer`. These are both compound units of `length` and `volume` but are inverse representations from each other.
-
v3.5.0-rc.1 Changes
๐ This is the changelog for Cldr_units v3.5.0-rc.1 released on March 21st, 2021. For older changelogs please consult the release tag on GitHub
Overview
๐ In this release the
Cldr.Unit.to_string/{1, 2, 3}
function has been rewritten and the concrete impementation is now inCldr.Unit.Format
. The primary reasons for rewriting are:๐ 1. Improves performance by 20% over the old implementation. ๐ 2. Supports grammatical case and grammatical gender. These allow for better sentence formation in a localised fashion. Only are few locales have the required data for now (for example,
fr
andde
) however more locales will have data in upcoming CLDR releases.โ Note that full testing of grammatical case and grammatical gender variations is not yet complete.
๐ Soft Deprecation
๐ The function
Cldr.Unit.to_iolist/{1, 2, 3}
is soft deprecated. It is still available and no deprecation warning is emitted. It will however be removed from the public API in a future release. This function is primarily used to support implementation ofCldr.Unit.to_string/3
As of this release, argument checking in
Cldr.Unit.to_iolist/3
is less rigorous in order to avoid the relatively expensive argument normalization process happening twice (once inCldr.Unit.to_string/3
and then again inCldr.Unit.to_iolist/3
).
๐ Bug Fixes
- The new string formatter correctly assembles units with an SI prefix (ie
millimeter
) in languages such as German where the noun is capitalized.
-
v3.5.0-rc.0 Changes
๐ This is the changelog for Cldr_units v3.5.0-rc.0 released on March 19th, 2021. For older changelogs please consult the release tag on GitHub
๐ Bug Fixes
๐ Fixes calculating the base unit when the unit is a complex compound unit.
โ Remove double parsing when calling
Cldr.Unit.new/2
and the unit is not inCldr.Unit.known_units/0
Ensure
Cldr.Unit.unit_category/1
returns an error tuple if the category is unknown
โจ Enhancements
๐ฆ Updated to require ex_cldr version 2.20 which includes CLDR 39 data.
Add
Cldr.Unit.known_grammatical_cases/0
Add
Cldr.Unit.known_grammatical_genders/0
Add
Cldr.Unit.known_measurement_system_names/0
โ Add
Cldr.Unit.invert/1
to invert a "per" unit. This allows for increased compatibility for conversions. For example, "liters per 100 kilometers" is a measure of consumption, as is "miles per gallon". However these two units are not convertible without inverting one of them first since one is "volume per length" and the other is "length per volume".โ Add
Cldr.Unit.conversion_for/2
to return a conversion list used when converting one unit to another.โ Add
Cldr.Unit.grammatical_gender/2
to return the grammatical gender for a given unit and localeโ Add
Cldr.Unit.conversion_for/2
to return a conversion list used when converting one unit to another.Add support for grammatical cases for
Cldr.Unit.to_string/2
andCldr.Unit.to_iolist/2
. Not all locales support more than the nominative case. The nominative case is the default. Any configured "Additional Units" in a backend module will need to be modified to put the localisations a map with the key:nominative
. See the readme for more information on migrating additional units. On example is:defmodule MyApp.Cldr do use Cldr.Unit.Additional
use Cldr, locales: ["en", "fr", "de", "bs", "af", "af-NA", "se-SE"], default_locale: "en", providers: [Cldr.Number, Cldr.Unit, Cldr.List]
unit_localization(:person, "en", :long, nominative: %{ one: "{0} person", other: "{0} people" }, display_name: "people" ) end
* ๐ Support conversions where one of the base units is the inverted conversion of the other. This allows conversion between, for example, `mile per gallon` and `liter per 100 kilometer`. These are both compound units of `length` and `volume` but are inverse representations from each other.
-
v3.4.0 Changes
๐ This is the changelog for Cldr_units v3.4.0 released on February 9th, 2021. For older changelogs please consult the release tag on GitHub
๐ Bug Fixes
๐ Fix readme example for
MyApp.Cldr.Unit.convert/2
. Thanks to @DamienFF. Closes #16.โ Add missing
<backend>.convert!/2
โจ Enhancements
๐ Supports the definition of custom units in
config.exs
.โ Add
Cldr.Unit.display_name/2
Add
Cldr.Unit.known_units_by_category/0
Add
Cldr.Unit.known_units_for_category/1
Add
Cldr.Unit.measurement_system_units/0
Add
Cldr.Unit.measurement_system_from_locale/{2, 3}
Add
Cldr.Unit.measurement_system_for_territory/1
Add
Cldr.Unit.measurement_systems_for_unit/1
๐ Improve
Cldr.Unit.IncompatibleUnit
exception error messageDeprecate
Cldr.Unit.measurement_systems/0
in favour ofCldr.Unit.measurement_systems_by_territory/0
Requires
ex_cldr
version~> 2.19
which includes the localised display name of units
-
v3.3.1 Changes
November 03, 2020๐ This is the changelog for Cldr_units v3.3.1 released on November 3rd, 2020. For older changelogs please consult the release tag on GitHub
๐ Bug Fixes
- ๐ Fix
Cldr.Unit.localize/2
when no options are provided
- ๐ Fix
-
v3.3.0 Changes
November 01, 2020 -
v3.3.0-rc.0 Changes
October 27, 2020โจ Enhancements
- โก๏ธ Update to CLDR38
-
v3.2.1 Changes
September 26, 2020๐ This is the changelog for Cldr_units v3.2.1 released on September 26th, 2020. For older changelogs please consult the release tag on GitHub
๐ Bug Fixes
- Use
Cldr.default_backend!/0
when available (as in later ex_cldr releases) sinceCldr.default_backend/0
is deprecated.
- Use