Changelog History
Page 4
-
v2.6.1 Changes
August 31, 2019๐ This is the changelog for Cldr_units v2.6.1 released on August 31st, 2019. For older changelogs please consult the release tag on GitHub
๐ Bug Fixes
- ๐ Fix
Cldr.Unit.to_string/3
to ensure that{:ok, string}
is returned when formatting a list of units
- ๐ Fix
-
v2.6.0 Changes
๐ This is the changelog for Cldr_units v2.6.0 released on August 25th, 2019. For older changelogs please consult the release tag on GitHub
โจ Enhancements
- โ Add
Cldr.Unit.localize/3
to support converting a given unit into units that are familiar to a given territory. For example, given a unit of#Unit<2, :meter>
is would normally be expected to show this as[#Unit<:foot, 5>, #Unit<:inch, 11>]
. The data to support these conversions is returned byCldr.Unit.unit_preferences/0
. An example:
iex> height = Cldr.Unit.new(1.8, :meter) iex> Cldr.Unit.localize height, :person, territory: :US, style: :informal [#Unit<:foot, 5>, #Unit<:inch, 11>]
- Note that conversion is dependent on context. The context above is
:person
reflecting that we are referring to the height of a person. For units oflength
category, the other contexts available are:rainfall
,:snowfall
,:vehicle
,:visibility
and:road
. Using the above example with the context of:rainfall
we see
iex> Cldr.Unit.localize height, :rainfall, territory: :US [#Unit<:inch, 71>]
๐ Adds a
:per
option toCldr.Unit.to_string/3
. This option leverages theper
formatting style to allow compound units to be printed. For example, assume want to emit a string which represents "kilograms per second". There is no such unit defined in CLDR (or perhaps anywhere!). But if we define the unitunit = Cldr.Unit.new(:kilogram, 20)
we can then executeCldr.Unit.to_string(unit, per: :second)
. Each locale defines a specific way to format such a compount unit. Usually it will return something like20 kilograms/second
โ Adds
Cldr.Unit.unit_preferences/0
to map units into a territory preference alternative unitโ Adds
Cldr.Unit.measurement_systems/0
that identifies the unit system in use for a territoryAdds
Cldr.Unit.measurement_system_for/1
that returns the measurement system in use for a given territory. The result will be one of:metric
,:US
or:UK
.
๐ Deprecation
- ๐ Add
Cldr.Unit.unit_category/1
and deprecateCldr.Unit.unit_type/1
in order to be consistent with the nomenclature of CLDR
- โ Add
-
v2.5.3 Changes
๐ This is the changelog for Cldr_units v2.5.3 released on August 23rd, 2019. For older changelogs please consult the release tag on GitHub
๐ Bug Fixes
- Fix
@spec
forCldr.Unit.to_string/3
andCldr.Unit.to_string!/3
- Fix
-
v2.5.2 Changes
๐ This is the changelog for Cldr_units v2.5.2 released on August 21st, 2019. For older changelogs please consult the release tag on GitHub
๐ Bug Fixes
Replace
Cldr.get_current_locale/0
withCldr.get_locale/0
in docs๐ Fix dialyzer warnings
-
v2.5.1 Changes
๐ This is the changelog for Cldr_units v2.5.1 released on June 18th, 2019. For older changelogs please consult the release tag on GitHub
โจ Enhancements
โ Standardize the development cldr backend as
MyApp.Cldr
which makes for more understandable and readable examples and doc tests0๏ธโฃ
Cldr.Unit.to_string/3
now allows for thebackend
parameter to default toCldr.default_backend/0
-
v2.5.0 Changes
๐ This is the changelog for Cldr_units v2.5.0 released on March 28th, 2019. For older changelogs please consult the release tag on GitHub
โจ Enhancements
- ๐ Updates to CLDR version 35.0.0 released on March 27th 2019.
-
v2.4.0 Changes
๐ This is the changelog for Cldr_units v2.4.0 released on March 23rd, 2019. For older changelogs please consult the release tag on GitHub
โจ Enhancements
- ๐ Supports
Cldr.default_backend()
as a default forbackend
parameters inCldr.Unit
- ๐ Supports
-
v2.3.3 Changes
๐ This is the changelog for Cldr_units v2.3.2 released on March 23rd, 2019. For older changelogs please consult the release tag on GitHub
๐ Bug Fixes
- ๐ฆ Include
priv
directory in the hex package (thats where the conversion json exists)
- ๐ฆ Include
-
v2.3.2 Changes
๐ This is the changelog for Cldr_units v2.3.2 released on March 20th, 2019. For older changelogs please consult the release tag on GitHub
๐ Bug Fixes
- ๐ Fix dialyzer warnings
-
v2.3.1 Changes
๐ This is the changelog for Cldr_units v2.3.1 released on March 15th, 2019. For older changelogs please consult the release tag on GitHub
โจ Enhancements
- ๐ Makes generation of documentation for backend modules optional. This is implemented by the
:generate_docs
option to the backend configuration. The default istrue
. For example:
defmodule MyApp.Cldr do use Cldr, default_locale: "en-001", locales: ["en", "ja"], gettext: MyApp.Gettext, generate_docs: false end
- ๐ Makes generation of documentation for backend modules optional. This is implemented by the