Localize version 0.43.0
[0.43.0] — July 4th, 2026
This release settles the public API naming and error conventions ahead of 1.0. Every renamed function keeps its old name as a deprecated delegate that will be removed by Localize 1.0 and no later than December 2026.
Deprecated
The naming rule is now uniform: known_* is the locale-independent CLDR universe, supported_* reflects configuration, and *_for is data localized into a display locale. The renamed functions are:
-
Language.available_languages/1→Language.languages_for/1. -
Language.known_languages/1→Language.language_names_for/1. -
Script.available_scripts/1→Script.scripts_for/1. -
Script.known_scripts/1→Script.script_names_for/1. -
Subdivision.available_subdivisions/1→Subdivision.subdivisions_for/1. -
Subdivision.known_subdivisions/1→Subdivision.subdivision_names_for/1. -
Territory.available_styles/0→Territory.known_styles/0.
Two option names are also swapped for consistency; the deprecated keys remain accepted until 1.0:
-
The
:styleoption ofLocalize.Duration.to_string/2and ofLocalize.quote/2is deprecated in favour of:format. -
The
:formatoption ofLocalize.Unit.display_name/2is deprecated in favour of:style.
Changed
-
Language.display_name/2andScript.display_name/2return{:error, %Localize.InvalidValueError{}}for an invalid:styleor:fallbackoption instead of raising; the!variants raise as before. -
Localize.quote/2returns an error for an unknown format instead of silently returning the input string unquoted. -
The
backend: :nifpaths ofNumber.to_string/2,Number.PluralRule.plural_type/2,Unit.to_string/2andMessage.format/3now validate the locale throughLocalize.validate_locale/1and pass ICU the canonical BCP 47 string, so both backends resolve aliases and-u-extensions identically. -
Internal implementation modules (
Localize.Utils.*, collation internals, data plumbing) are no longer part of the documented API. The hex package metadata links now point at hexdocs.
Added
-
Localize.Territory.known_territories/0returns all CLDR territory codes. -
Localize.validate_currency/1delegates toLocalize.Currency.validate_currency/1so all validators are available on the top module. -
Bang variants:
Number.to_at_least_string!/2,Number.to_at_most_string!/2,Number.to_approximately_string!/2,Calendar.display_name!/3andUnit.display_name!/2.