Releases: elixir-cldr/cldr_messages
Cldr Numbers version 1.0.2
Cldr Messages version 1.0.1
Bug Fixes
- Fix parsing and printing of escaped strings. The implementation follows the ICU Message format documentation. Closes #17.
Cldr Messages version 1.0.0
Since the API has been stable for over a year, this becomes the 1.0 release.
Bug Fixes
-
Fix
Cldr.Message.Print.to_string/2
to force a deterministic order ofchoice
s. -
Fix extracting variable bindings from
simple_format
. Thanks to @AlexisChavez97 for the report and the PR. Closes #16. -
Bump Elixir minimum required version to 1.11 to match the rest of
ex_cldr
.
Cldr Messages version 0.14.0
Enhancements
- Updates to ex_cldr version 2.26.0 which uses atoms for locale names and rbnf locale names. This is consistent with out elements of
t:Cldr.LanguageTag
where atoms are used where the cardinality of the data is fixed and relatively small and strings where the data is free format.
Cldr Messages version 0.13.1
Bug Fixes
-
Fix
Cldr.Message.Interpolate.compile_interpolate/3
to ensure that the parsed message is escaped AST. Closes #11. -
Fix passing RBNF format names as number format styles.
-
Fix converting strings to atoms at compile time. Previously these uses
String.to_existing_atom/1
however the compilation graph sometimes means that the expected atoms are not available. ThereforeString.to_atom/1
is now called. As a result, it is very important to note that allowing arbitrary message formats into the system could open an attack vector to exhaust the atom table.
Cldr Messages version 0.13.0
Bug Fixes
-
Don't add
:gettext
toMix.compilers/0
because it gets inherited into client applications and we wantGettext
to remain optional. Thanks to @trarbr for the report. -
Fix typos. Thanks as always to @kianmeng
Enhancements
- Add an Elixir formatter plugin for
sigil_M
. For example in your.formatter.exs
file:
[
inputs: ["mix.exs", "{config,lib,test,mix}/**/*.{ex,exs}"],
locals_without_parens: [docp: 1, defparsec: 2, defparsec: 3],
plugins: [Cldr.Formatter.Plugin]
]
Cldr Messages version 0.12.0
Enhancements
The primary focus of this release is gettext integration. The effort is kindly driven by @maennchen and the majority of the work is his.
-
Add
Cldr.Message.format_to_iolist/3
which formats a binary message into an iolist. This helps with incrementally binding placeholders where some may be bound at compile time and others at runtime. It also makes integration withgettext
simpler since this function returns a list of completed bindings and a list of bindings that were not found. -
Adds an implementation of
Gettext.Interpolation
to supportgettext
integration.
Cldr Messages version 0.11.0
Enhancements
-
Add
Cldr.Message.bindings/1
to extract the names of variable bindings for a message -
Add option
:allow_positional_args
toCldr.Message.format/3
. The default istrue
. -
Add argument
allow_positional_args?
toCldr.Message.Parser.parse/2
Cldr Messages version 0.10.0
Enhancements
- Use
Cldr.default_backend!/0
if available
Cldr Messages version 0.9.0
Enhancements
- Supports number arguments to be either a number or a tuple of the form
{number, keyword_list_of_formatting_options}
. This provides an escape hatch for developers to influence formatting of the number beyond the textual format of the message. For example:
# Uses the currency for the current locale
iex> Cldr.Message.format "this is {one, number, currency}", one: 1
{:ok, "this is $1.00"}
# Forces the :MXP currency
iex> Cldr.Message.format "this is {one, number, currency}", one: {1, currency: :MXP}
{:ok, "this is MXP 1.00"}