Localize version 0.41.2
[0.41.2] — July 1st, 2026
Bug Fixes
-
Plural rules now resolve likely subtags before selecting a rule set.
Localize.Number.PluralRule.CardinalandOrdinal(pluralize/3,plural_rules_for/1,plural_rule/3) andLocalize.Number.PluralRule.plural_type/2validate the locale throughLocalize.validate_locale/1instead of a bare parse, so a string and an equivalentLocalize.LanguageTagselect the same category and region-specific rules apply — e.g.plural_rule(0, "pt-PT")is now:other(Portugal) rather than:one(the basept/Brazil rule). This also corrects plural selection in message formatting. -
Localize.Territory.contains?/2now validates both arguments, so string and atom territories are equivalent (contains?("EU", "DK")matchescontains?(:EU, :DK)); it returnsfalsefor an invalid territory instead of silently treating a string as unmatched. It now also accepts territory strings, matching its sibling relationship functions. -
Localize.Collation.Options.from_locale/1now canonicalises its input throughLocalize.validate_locale/1, so a string, atom, and equivalentLocalize.LanguageTagyield identical collation options and legacy aliases resolve correctly ("iw"behaves as"he","pt_BR"as"pt-BR").