CLDR locale-specific collation tailoring.
Parses and applies CLDR tailoring rules that modify the root collation order for specific locales. Rules use the ICU/CLDR syntax defined in UTS #35:
&X- reset position to after character X.&[before N]X- reset to just before X at level N.<- primary difference (new letter).<<- secondary difference (accent variant).<<<- tertiary difference (case variant).[caseFirst upper]- option overrides.
Tailoring data is embedded directly from CLDR XML sources, covering common European and Asian locales.
Summary
Functions
Get a tailoring overlay for the given locale and collation type.
Parse a CLDR tailoring rule string into a list of operations.
List all supported locale/type combinations.
Functions
Get a tailoring overlay for the given locale and collation type.
Arguments
language- ISO 639 language code (e.g.,"sv","de","es").type- collation type atom (e.g.,:standard,:phonebook,:traditional).
Returns
{overlay, option_overrides}- a map of overlay entries and a keyword list of option overrides.nil- if no tailoring exists for the given locale and type.
Parse a CLDR tailoring rule string into a list of operations.
Arguments
rules_str- a CLDR/ICU tailoring rule string.
Returns
A list of operation tuples.
Examples
iex> ops = Localize.Collation.Tailoring.parse_rules("&N<ñ<<<Ñ")
iex> length(ops)
3
List all supported locale/type combinations.
Returns
A list of {language, type} tuples.
Examples
iex> locales = Localize.Collation.Tailoring.supported_locales()
iex> {"es", :standard} in locales
true