Repository navigation
[1.3.0] — 2026-10-24
Breaking changes
-
Requires
localize ~> 1.4. Localize 1.4 returns{:error, exception}for a value of the wrong type, so the type checkslocalize_webcarried ahead of its validators are removed; an invalid currency or territory is now reported as Localize reports it,Localize.UnknownCurrencyErrororLocalize.UnknownTerritoryError, where it wasLocalize.InvalidValueError. -
Localize.Routes.LocalizedHelpers.hreflang_links/1returns{:ok, safe}or{:error, exception}rather than the rendered HTML, and no longer emits an annotation it cannot validate. A locale that does not resolve returnsLocalize.InvalidLocaleErrorand a URL that is not fully qualified returnsLocalize.RelativeUrlError; search engines ignore both silently, so the site appeared not to declare the variant at all.
Added
-
Localize.HTML.Hreflang.links/2rendersrel="alternate"hreflangannotations from a map of locale to URL, validating each locale and rendering it in canonical BCP 47 form, so"es_MX"becomes"es-MX". The key"x-default"designates the fallback variant and is emitted as supplied. -
hreflang_links/2inLocalize.VerifiedRoutesrenders the annotation set for a route across every configured locale, so verified routes have the same support the generated helpers had.
Changed
- A
Localize.LanguageTaggiven topath_for/2,url_for/2or~q, or found by the:routesource ofLocalize.Plug.PutLocale, is used as it stands rather than validated again, so a tag whose locale has no routes takes the default locale's. Build tags withLocalize.validate_locale/1.
Fixed
Localize.HTML.Localenames each locale in its option list on Localize 1.4, where every option showed its code: its default:preferwas:default, which Localize 1.4 rejects.