Skip to content

Releases: elixir-cldr/cldr_messages

Cldr Numbers version 1.0.2

19 Dec 14:26
Compare
Choose a tag to compare

Bug Fixes

  • Restore ex_cldr_numbers as a required dependency. Thanks to @flurin for the report. Closes #18.

Cldr Messages version 1.0.1

21 Oct 01:34
Compare
Choose a tag to compare

Bug Fixes

Cldr Messages version 1.0.0

04 Oct 17:00
Compare
Choose a tag to compare

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 of choices.

  • 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

21 Feb 18:16
Compare
Choose a tag to compare

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

12 Jan 17:30
Compare
Choose a tag to compare

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. Therefore String.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

12 Jan 17:47
Compare
Choose a tag to compare

Bug Fixes

  • Don't add :gettext to Mix.compilers/0 because it gets inherited into client applications and we want Gettext 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

31 Dec 20:11
Compare
Choose a tag to compare

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 with gettext 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 support gettext integration.

Cldr Messages version 0.11.0

23 May 02:04
Compare
Choose a tag to compare

Enhancements

  • Add Cldr.Message.bindings/1 to extract the names of variable bindings for a message

  • Add option :allow_positional_args to Cldr.Message.format/3. The default is true.

  • Add argument allow_positional_args? to Cldr.Message.Parser.parse/2

Cldr Messages version 0.10.0

08 Apr 09:16
Compare
Choose a tag to compare

Enhancements

  • Use Cldr.default_backend!/0 if available

Cldr Messages version 0.9.0

17 Nov 21:51
Compare
Choose a tag to compare

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"}