Cldr.Locale.substitute_aliases
You're seeing just the function
substitute_aliases
, go back to Cldr.Locale module for more information.
Substitute deprectated subtags with a Cldr.LanguageTag
with their
non-deprecated alternatives.
Arguments
language_tag
is any language tag returned byCldr.Locale.new/2
Method
Replace any deprecated subtags with their canonical values using the alias data. Use the first value in the replacement list, if it exists. Language tag replacements may have multiple parts, such as
sh
➞sr_Latn
ormo
➞ro_MD
. In such a case, the original script and/or region/territory are retained if there is one. Thussh_Arab_AQ
➞sr_Arab_AQ
, notsr_Latn_AQ
.Remove the script code 'Zzzz' and the territory code 'ZZ' if they occur.
Get the components of the cleaned-up source tag (languages, scripts, and regions/territories), plus any variants and extensions.
Example
iex> Cldr.Locale.substitute_aliases Cldr.LanguageTag.Parser.parse!("mo")
%Cldr.LanguageTag{
backend: nil,
canonical_locale_name: nil,
cldr_locale_name: nil,
extensions: %{},
gettext_locale_name: nil,
language: "ro",
language_subtags: [],
language_variant: nil,
locale: %{}, private_use: [],
rbnf_locale_name: nil,
requested_locale_name: "mo",
script: nil, transform: %{},
territory: nil
}