Skip to content

Releases: elixir-cldr/cldr

Cldr version 1.5.0

29 Mar 00:01
Compare
Choose a tag to compare

Enhancements

Cldr version 1.4.5

25 Mar 00:45
Compare
Choose a tag to compare

Bug Fixes

  • Fixed Cldr.Math.power/2 for Decimal numbers with a coefficient of 10 and an exponent <> 1. Thanks to @CamonZ

  • Correct typos in README. Thanks to @zacca

  • Fixed Cldr.Map.deep_merge/2/3 to skip structs since their keys are atoms and they don't support Enumerable

  • Fixed the the mix task generation of language tags for all locales. This issue occasionally exhibited itself as compile errors on Cldr.Numbers (ex_cldr_numbers) as "unknown locale".

  • Fixed exception when the :cldr compiler is trying to remove module Beam files

  • Removed .erl generated files from the repo (they will be created at compile time)

Cldr version 1.4.4

25 Feb 13:13
Compare
Choose a tag to compare

Enhancements

  • Cldr.Config functions that deal with directory and file paths now return results generated at runtime rather than at compile time

  • An exception is raised at compile time if the :cldr compiler is configured but it is not the last compiler in the list returned by Mix.Project.config[:compilers]

  • Renamed language_tags to language_tags.ebin to better reflect that its a file containing erlang binary terms

Cldr version 1.4.3

19 Feb 02:31
Compare
Choose a tag to compare

Enhancements

  • When a locale configuration change is detected a coloured diff of the locale configuration is printed.

  • When the :cldr compiler runs, call Mix.Project.build_structure/0 for each Cldr dependency to ensure the priv directory is copied to the build directory.

Cldr version 1.4.2

11 Feb 16:12
Compare
Choose a tag to compare

Bug Fixes

  • Remove the hard-coded reference to the Poison library in Cldr.Rbnf.Config and replace it with the canonical Cldr.Config.json_library/0

Enhancements

  • Improve the error message raised at compile time if no valid json library has been detected

Cldr version 1.4.1

08 Feb 08:45
Compare
Choose a tag to compare

As reported by @marceldegraaf there has been a regression in the performance of Cldr.DateTime.to_string/2. The use case he reported involved calls with locale: "nl"; ie using a binary :locale.

In all cases, locale resolution is passed through Cldr.validate_locale/1. In prior releases of Cldr this would require parsing the locale name which is a relatively expensive operation.

Therefore the major focus on this small release is to pre-parse all configured locale names into their corresponding language tag. As a result performance is largely the same whether locale is specified as a binary or as a language tag.

Enhancements

  • Precompiles all known locale names into a language tag which are then used to generate locale specific versions of Cldr.validate_locale/1 when the parameter is a binary.

  • Adds a mix task (available in github, not in the hex package) to generate the language tags for all available locales to support the performance optimization of locale to langauge tag lookup which is used in Cldr.validate_locale/1 in many places in `Cldr.

  • Automatically detects the presence of Jason and Poison and configures the default :json_library appropriately.

Cldr version 1.4.0

04 Feb 01:31
Compare
Choose a tag to compare

Enhancements

  • Updates CLDR data to version 32.0.1

  • The primary focus on this release to automate the process of recompiling those parts of Cldr that are sensitive to configuration change. This release:

    • Adds a compiler.cldr as a Mix compiler. This provides the functions that identify a locale configuration change and then recompile the relevant modules of Cldr. Basically it looks in all dependencies for any module that calls functions in Cldr.Config Therefore it is expected to work for Cldr and any package that depends on Cldr.

    • To enable this functionality, the compiler.cldr mix task needs to be added in mix.exs as the last compiler in the list. For example

  def project do
    [
      app: :app_name,
      ...
      compilers: Mix.compilers ++ [:cldr],
      start_permanent: Mix.env == :prod,
      deps: deps()
    ]
  end
  • With this enhancement it will be no longer necessary to force recompile Cldr or packages that depend on it since they will be compiled whenever a locale configuration change is detected.

  • The Jason json library is added to the dependency list as an optional dependency.

  • Adds :iso_digits to the currency data maintained in CLDR. Cldr currency data does not always align with the ISO definition of a currency - notably for digits (subunit) definitions. For example, the Colombian Peso has an official subunit of the pesavo. One hundred pesavos equals one peso. There are no notes/cash/coins for the centavo but it is an offical part of the currency and it's important to be maintained for financial transactions.

  • Adds a Mix task to download the ISO currency data that is used during locale consolidation to include ISO currency digits (subunits) in the currency definition. This is used downstream in the ex_money package.

Bug Fixes

  • Don't raise an exception if a Gettext backend is defined but it has no configuration for :default_locale. Fixes #38. Thanks to @Schultzer.

  • Fix incorrect boolean expression, replace with && when determining if Gettext is configured.

  • Remove unused var warnings when compiing on Elixir 1.7.0 master branch. Fixes #40. Thanks to @michalmuskala.

  • Fix README config.exs examples to use the correct config key :ex_cldr. Fixes #41. Thanks to @phtrivier.

  • Fix detecting a Gettext locale configuration by adding the :cldr compiler. Fixes #31. Thanks to @BrummbQ.

  • Ensure that the default locale is also expanded. If no default locale is configured, the package default "en-001" is defined. This locale should also be expanded to include "en" since plural rules are often defined on the language rather than the territory-specific locale.

Cldr version v1.4.0-rc.3

31 Jan 12:06
Compare
Choose a tag to compare
Pre-release

Unless further bugs reported this is the final candidate release.

Enhancements

  • The primary focus on this release to automate the process of recompiling those parts of Cldr that are sensitive to configuration change. This release:

    • Adds a compiler.cldr as a Mix compiler. This provides the functions that identify a locale configuration change and then recompile the relevant modules of Cldr. Basically it looks in all dependencies for any module that calls functions in Cldr.Config Therefore it is expected to work for Cldr and any package that depends on Cldr.

    • To enable this functionality, the compiler.cldr mix task needs to be added in mix.exs as the last compiler in the list. For example

  def project do
    [
      app: :app_name,
      ...
      compilers: Mix.compilers ++ [:cldr],
      start_permanent: Mix.env == :prod,
      deps: deps()
    ]
  end
  • With this enhancement it will be no longer necessary to force recompile Cldr or packages that depend on it since they will be compiled whenever a locale configuration change is detected.

  • Please note that the :cldr compiler is only available on Elixir version 1.6.0 and later since it depends on Mix.Tasks.Xref.calls/0. In the case of Elixir versions up to 1.5 a manual mix deps.compile ex_cldr --force will be required if the locale configuration changes.

  • The Jason json library is added to the dependency list as an optional dependency.

  • Adds :iso_digits to the currency data maintained in CLDR. Cldr currency data does not always align with the ISO definition of a currency - notably for digits (subunit) definitions. For example, the Colombian Peso has an official subunit of the pesavo. One hundred pesavos equals one peso. There are no notes/cash/coins for the centavo but it is an offical part of the currency and it's important to be maintained for financial transactions.

  • Adds a Mix task to download the ISO currency data that is used during locale consolidation to include ISO currency digits (subunits) in the currency definition.

Bug Fixes

  • Don't crash if a Gettext backend is defined by it has no configuration for :default_locale. Closes #38. Thanks to @Schultzer.

  • Fix incorrect boolean expression, replace with && when determining if Gettext is configured

  • Create a "null" Cldr compiler so that on Elixir versions less than 1.6 we don't raise an exception if the compiler is configured.

Cldr version 1.4.0-rc.2

31 Jan 11:13
Compare
Choose a tag to compare
Pre-release

Enhancements

  • The primary focus on this release to automate the process of recompiling those parts of Cldr that are sensitive to configuration change. This release:

    • Adds a compiler.cldr as a Mix compiler. This provides the functions that identify a locale configuration change and then recompile the relevant modules of Cldr. Basically it looks in all dependencies for any module that calls functions in Cldr.Config Therefore it is expected to work for Cldr and any package that depends on Cldr.

    • To enable this functionality, the compiler.cldr mix task needs to be added in mix.exs as the last compiler in the list. For example

  def project do
    [
      app: :app_name,
      ...
      compilers: Mix.compilers ++ [:cldr],
      start_permanent: Mix.env == :prod,
      deps: deps()
    ]
  end
  • With this enhancement it will be no longer necessary to force recompile Cldr or packages that depend on it since they will be compiled whenever a locale configuration change is detected.

  • Please note that the :cldr compiler is only available on Elixir version 1.6.0 and later since it depends on Mix.Tasks.Xref.calls/0. In the case of Elixir versions up to 1.5 a manual mix deps.compile ex_cldr --force will be required if the locale configuration changes.

  • The Jason json library is added to the dependency list as an optional dependency.

  • Adds :iso_digits to the currency data maintained in CLDR. Cldr currency data does not always align with the ISO definition of a currency - notably for digits (subunit) definitions. For example, the Colombian Peso has an official subunit of the pesavo. One hundred pesavos equals one peso. There are no notes/cash/coins for the centavo but it is an offical part of the currency and it's important to be maintained for financial transactions.

  • Adds a Mix task to download the ISO currency data that is used during locale consolidation to include ISO currency digits (subunits) in the currency definition.

Bug Fixes

  • Don't crash if a Gettext backend is defined by it has no configuration for :default_locale. Closes #38. Thanks to @Schultzer.

  • Fix incorrect boolean expression, replace with && when determining if Gettext is configured

Cldr version 1.4.0-rc.1

31 Jan 08:35
Compare
Choose a tag to compare
Pre-release

Changelog for Cldr v1.4.0

This is expected to be the final release candidate for Cldr version 1.4.0. It will be released as a final version by February 2nd if no further issues are found.

Enhancements

  • The primary focus on this release to automate the process of recompiling those parts of Cldr that are sensitive to configuration change. This release:

    • Adds a compiler.cldr as a Mix compiler. This provides the functions that identify a locale configuration change and then recompile the relevant modules of Cldr. Basically it looks in all dependencies for any module that calls functions in Cldr.Config Therefore it is expected to work for Cldr and any package that depends on Cldr.

    • To enable this functionality, the compiler.cldr mix task needs to be added in mix.exs as the last compiler in the list. For example

  def project do
    [
      app: :app_name,
      ...
      compilers: Mix.compilers ++ [:cldr],
      start_permanent: Mix.env == :prod,
      deps: deps()
    ]
  end
  • With this enhancement it will be no longer necessary to force recompile Cldr or packages that depend on it since they will be compiled whenever a locale configuration change is detected.

  • The Jason json library is added to the dependency list as an optional dependency.

  • Adds :iso_digits to the currency data maintained in CLDR. Cldr currency data does not always align with the ISO definition of a currency - notable for digits (subunit) definitions. For example, the Colombian Peso has an official subunit of the pesavo. One hundred pesavos equals one peso. There are no notes/cash/coins for the centavo but it is an offical part of the currency and its important to be maintained for financial transactions.

  • Adds a Mix task to download the ISO currency data that is used during locale consolidation to include ISO currency digits (subunits) in the currency definition.

Bug Fixes

  • Don't crash if a Gettext backend is defined by it has no configuration for :default_locale. Closes #38. Thanks to @Schultzer.