This is the changelog for Cldr_Messages v1.0.0 released on October 5th, 2023. For older changelogs please consult the release tag on GitHub
Since the API is stable, this becomes the 1.0 release.
-
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
.
This is the changelog for Cldr_Messages v0.14.1 released on October 4th, 2022. For older changelogs please consult the release tag on GitHub
- Returns a partially formatted message if bindings are missing. The message will be interpolated as far as possibly making the error message more meaningful for end user consumption. Thanks to @maennchen for the PR. Closes #14.
This is the changelog for Cldr_Messages v0.14.0 released on February 22nd, 2022. For older changelogs please consult the release tag on GitHub
- Updates to ex_cldr version 2.26.0 which uses atoms for locale names and rbnf locale names. This is consistent with other 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.
This is the changelog for Cldr_Messages v0.13.2 released on January 14th, 2022. For older changelogs please consult the release tag on GitHub
- Fixes formatting when there is no
:message_formats
configured on a backend. Closes #11, again.
This is the changelog for Cldr_Messages v0.13.1 released on January 13th, 2022. For older changelogs please consult the release tag on GitHub
-
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.
This is the changelog for Cldr_Messages v0.13.0 released on January 2nd, 2022. For older changelogs please consult the release tag on GitHub
-
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
- 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]
]
This is the changelog for Cldr_Messages v0.12.0 released on January 1st, 2022. For older changelogs please consult the release tag on GitHub
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.
This is the changelog for Cldr_Messages v0.11.0 released on May 23rd, 2021. For older changelogs please consult the release tag on GitHub
-
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
This is the changelog for Cldr_Messages v0.10.0 released on April 8th, 2021. For older changelogs please consult the release tag on GitHub
- Use
Cldr.default_backend!/0
if available
This is the changelog for Cldr_Messages v0.9.0 released on November 18th, 2019. For older changelogs please consult the release tag on GitHub
- 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"}
This is the changelog for Cldr_Messages v0.8.0 released on September 27th, 2019. For older changelogs please consult the release tag on GitHub
- Fix
Cldr.Message.Print.to_string/2
to omit blank spaces at the end of lines when pretty printing.
This is the changelog for Cldr_Messages v0.7.0 released on September 26th, 2019. For older changelogs please consult the release tag on GitHub
- Allow
nimble_parsec
versions~> 0.5 or ~> 1.0
This is the changelog for Cldr_Messages v0.6.0 released on September 26th, 2019. For older changelogs please consult the release tag on GitHub
-
Add
Cldr.Message.canonical_message/2
that converts a string message into a canonical form. This allows for fuzzy matching between two messages that may have different formatting (this is possible since the CLDR message format allows for non-formatting whitespace in parts of the syntax). -
Add documentation for some of the key functions. Much more documentation required before 1.0 release.
This is the changelog for Cldr_Messages v0.5.0 released on September 22nd, 2019. For older changelogs please consult the release tag on GitHub
-
Adds compile time checking that bindings are provided to the
format/3
macro wherever possible -
Supports later versions of
ex_cldr
and friends,ex_money
as well as Elixir 1.11 without warnings
This is the changelog for Cldr_Messages v0.4.0 released on August 29th, 2019. For older changelogs please consult the release tag on GitHub
- Conditionally compile functions that depend on optional dependencies
This is the changelog for Cldr_Messages v0.3.0 released on August 29th, 2019. For older changelogs please consult the release tag on GitHub
- Standardize on the
Cldr.Message.format/3
as the public api.Cldr.Message.to_string/3
is removed.
- Add the macro
<backend>.Cldr.Message.format/3
to parse messages at compile time as a way to optiise performance at runtime. To use it addimport <backend>.Cldr.Message
to your module and useformat/3
. An example:
defmodule SomeModule do
import MyApp.Cldr.Message
def my_function do
format("this is a string with a param {param}", param: 3)
end
end
- Add
Cldr.Message.format_to_list/3
formats to anio_list
- Fix dialyzer warnings. There are some warnings from combinators that will require
nimble_parsec
version 0.5.2 to be published before they are resolved.
This is the changelog for Cldr_Messages v0.2.0 released on August 27th, 2019. For older changelogs please consult the release tag on GitHub
- Uses
Cldr.Number.to_string/3
to format simple arguments that are numeric (integer, float and decimal). This gives a localised number format. An example:
iex> Cldr.Message.to_string "You have {number} jelly beans", number: 1234
"You have 1,234 jelly beans"
- Similarly applies localized formatting for dates, times, datetimes.
This is the changelog for Cldr_Messages v0.1.0 released on August 26th, 2019. For older changelogs please consult the release tag on GitHub
- Initial release. This release implements
Cldr.Message.to_string/3
andCldr.Message.format/3
This initial release is the basis for building a complete message localization solution as an alternative to Gettext. There is a long way to go until that is accomplished.