Preset collation option defaults for common locales.
Maps BCP47 language tags to their standard collation option overrides
as defined by CLDR. These defaults are applied before any explicit
BCP47 -u- extension keys.
Summary
Functions
Get the default collation type for a locale.
Extract the language subtag from a BCP47 locale string.
Get option overrides for a locale.
Functions
Get the default collation type for a locale.
Arguments
locale- a BCP47 locale string.
Returns
The default collation type atom for the locale, or :standard.
Examples
iex> Localize.Collation.Tailoring.LocaleDefaults.default_type("de")
:standard
iex> Localize.Collation.Tailoring.LocaleDefaults.default_type("es")
:standard
Extract the language subtag from a BCP47 locale string.
Arguments
locale- a BCP47 locale string.
Returns
The lowercase language subtag string.
Examples
iex> Localize.Collation.Tailoring.LocaleDefaults.extract_language("de-AT-u-co-phonebk")
"de"
iex> Localize.Collation.Tailoring.LocaleDefaults.extract_language("sv")
"sv"
Get option overrides for a locale.
Arguments
locale- a BCP47 locale string (e.g.,"da","de-AT","sv-SE").
Returns
A keyword list of option overrides, or an empty list if no defaults exist.
Examples
iex> Localize.Collation.Tailoring.LocaleDefaults.options_for("da")
[case_first: :upper]
iex> Localize.Collation.Tailoring.LocaleDefaults.options_for("en")
[]