Cldr v2.18.1 MyApp.Cldr.Locale View Source
Backend module that provides functions to define new locales.
Link to this section Summary
Functions
Returns the territory from a language tag or locale name.
Link to this section Functions
Specs
territory_from_locale(Cldr.LanguageTag.t() | Cldr.Locale.locale_name()) :: Cldr.territory()
Returns the territory from a language tag or locale name.
Arguments
localeis any language tag returned beCldr.Locale.new/2or a locale name in the list returned byCldr.known_locale_names/1
Returns
- A territory code as an atom
Examples
iex> MyApp.Cldr.Locale.territory_from_locale "en-US"
:US
iex> MyApp.Cldr.Locale.territory_from_locale "en-US-u-rg-GBzzzz"
:GB