Cldr.Locale.substitute_aliases

You're seeing just the function substitute_aliases, go back to Cldr.Locale module for more information.
Link to this function

substitute_aliases(language_tag)

View Source

Substitute deprectated subtags with a Cldr.LanguageTag with their non-deprecated alternatives.

Arguments

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 shsr_Latn or moro_MD. In such a case, the original script and/or region/territory are retained if there is one. Thus sh_Arab_AQsr_Arab_AQ, not sr_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
}