# `Cldr.Config`
[🔗](https://github.com/elixir-cldr/cldr/blob/v2.47.3/lib/cldr/config/config.ex#L1)

Provider configuration support
functions for ex_cldr.

The functions in this module should
be considered private use and they
may change at any time.

# `number_system`

```elixir
@type number_system() :: atom() | String.t()
```

# `t`

```elixir
@type t() :: %Cldr.Config{
  add_fallback_locales: boolean(),
  backend: module(),
  data_dir: String.t(),
  default_currency_format: :currency | :accounting | nil,
  default_locale: String.t(),
  force_locale_download: boolean(),
  generate_docs: boolean(),
  gettext: module() | nil,
  https_proxy: String.t() | nil,
  locales: [binary(), ...] | :all,
  message_formats: map(),
  otp_app: atom() | nil,
  precompile_date_time_formats: [String.t(), ...],
  precompile_interval_formats: [String.t(), ...],
  precompile_number_formats: [String.t(), ...],
  precompile_transliterations: [{atom(), atom()}, ...],
  providers: [atom(), ...],
  suppress_warnings: boolean()
}
```

# `aliases`

Returns the map of aliases for languages,
scripts and regions

# `all_language_tags`

Returns the map of language tags for all
available locales

# `all_language_tags?`

Returns a boolean indicating whether the language_tags.ebin
file exists

# `all_locale_names`

```elixir
@spec all_locale_names() :: [Cldr.Locale.locale_name(), ...]
```

Returns a list of all locales in the CLDR repository.

Returns a list of the complete locales list in CLDR, irrespective
of whether they are configured for use in the application.

Any configured locales that are not present in this list will
raise an exception at compile time.

# `app_name`

Return the configured application name
for cldr

Note this is probably `:ex_cldr` which is
what this app is called on `hex.pm`

# `calendar_data`

> This function is deprecated. Use Cldr.Config.calendars/0.

# `calendar_preferences`

Return the map of calendar preferences by territory

# `calendars`

Returns the data that defines start and end of
calendar eras.

## Example

    iex> Cldr.Config.calendars() |> Map.get(:gregorian)
    %{
      calendar_system: :solar,
      eras: [
        [0, %{code: :bce, end: [0, 12, 31], aliases: ["bc"]}],
        [1, %{code: :ce, start: [1, 1, 1], aliases: ["ad"]}]
      ]
    }

# `calendars_for_locale`

Returns the calendars available for a given locale name

## Example

    iex> Cldr.Config.calendars_for_locale "en", TestBackend.Cldr
    [:buddhist, :chinese, :coptic, :dangi, :ethiopic, :ethiopic_amete_alem,
     :generic, :gregorian, :hebrew, :indian, :islamic, :islamic_civil,
     :islamic_rgsa, :islamic_tbla, :islamic_umalqura, :iso8601, :japanese, :persian, :roc]

# `canonical_name`

# `canonical_timezones`

Returns a mapping of valid long timezone names
to their canonical equivalent.

# `cldr_data_dir`

Returns the path of the CLDR data directory for the ex_cldr app.

This is the directory where base CLDR data files are stored
including included locale files.

# `cldr_home`

Return the root path of the cldr application

# `client_data_dir`

```elixir
@spec client_data_dir(map()) :: String.t()
```

Return the path name of the CLDR data directory for a client
application.

The order of priority to determine where the client data
directory is located is:

* A specified `:data_dir` of a backend configuration
* The specified `:data_dir` of the backend's `:otp_app` configuration
* The specified `:data_dir` of the global configuration
* The `priv_dir()` of a specified `:otp_app`
* The `priv_dir()` of `ex_cldr`

Note that `config_from_opts/1` merges the global config,
the otp_app config and the module config together so
that `:data_dir` already resolves this priority in most
cases.

The remaining cases are for when no `:data_dir` is
specified.

# `client_locales_dir`

Returns the directory where downloaded ex_cldr locales files
are located.

# `configured_locale_names`

```elixir
@spec configured_locale_names(t()) :: [Cldr.Locale.locale_name()]
```

Returns a list of all locales configured in a
`Cldr.Config.t` struct.

In order of priority return either:

* The list of locales configured configured in mix.exs if any

* The default locale

If the configured locales is `:all` then all locales
in CLDR are configured.

The locale "und" is always added to the list of configured locales since it
is required to support some RBNF functions.

The use of `:all` is not recommended since all ~700 locales take
quite some time (minutes) to compile. It is however
helpful for testing Cldr.

# `currencies_for`

Returns the currency metadata for a locale.

## Arguments

* `locale` is any valid locale name returned by `Cldr.known_locale_names/1`
  or a `Cldr.LanguageTag` struct returned by `Cldr.Locale.new!/2`

* `config` is a `Config.Cldr.t()` struct or a `Cldr.backend()` module

# `currencies_for!`

# `day_period_info`

Returns the data that defines time periods of
a day for a language.

Time period rules are used to define the meaning
of "morning", "evening", "noon", "midnight" and
potentially other periods on a per-language basis.

## Example

    iex> Cldr.Config.day_period_info() |> Map.get("fr")
    %{"afternoon1" => %{"before" => [18, 0], "from" => [12, 0]},
      "evening1" => %{"before" => [24, 0], "from" => [18, 0]},
      "midnight" => %{"at" => [0, 0]},
      "morning1" => %{"before" => [12, 0], "from" => [4, 0]},
      "night1" => %{"before" => [4, 0], "from" => [0, 0]},
      "noon" => %{"at" => [12, 0]}}

# `default_backend`

Return the system-wide default backend

# `default_locale`

Return the system-wide default locale.

# `default_locale_name`

```elixir
@spec default_locale_name(t() | map()) :: Cldr.Locale.locale_name()
```

Return the default locale name for a given backend
configuration.

In order of priority return either:

* The default locale for a given backend configuration
* The global default locale specified in `mix.exs` under
  the `ex_cldr` key
* The `Gettext.get_locale/1` for the current configuration
* The system-wide default locale which is currently
  :"en-001"

# `download_data_dir`

Returns the directory where the downloaded CLDR repository files
are stored.

These are the real CLDR data files that are used only for the
development of ex_cldr.  They are not included in the hex
package.

# `expand_locale_names`

```elixir
@spec expand_locale_names([Cldr.Locale.locale_name() | String.t(), ...]) :: [
  Cldr.Locale.locale_name(),
  ...
]
```

Expands wildcards in locale names.

Locales often have region variants (for example en-AU is one of 104
variants in CLDR).  To make it easier to configure a language and all
its variants, a locale can be specified as a regex which will
then do a match against all CLDR locales.

For locale names that have a Script or Variant component the base
language is also configured since plural rules will fall back to the
language for these locale names.

## Examples

    iex> Cldr.Config.expand_locale_names(["en-A+"])
    [:"en-AE", :"en-AG", :"en-AI", :"en-AS", :"en-AT", :"en-AU"]

    iex> Cldr.Config.expand_locale_names(["fr-*"])
    [
      :"fr-BE", :"fr-BF", :"fr-BI", :"fr-BJ", :"fr-BL", :"fr-CA",
      :"fr-CD", :"fr-CF", :"fr-CG", :"fr-CH", :"fr-CI", :"fr-CM", :"fr-DJ",
      :"fr-DZ", :"fr-GA", :"fr-GF", :"fr-GN", :"fr-GP", :"fr-GQ", :"fr-HT",
      :"fr-KM", :"fr-LU", :"fr-MA", :"fr-MC", :"fr-MF", :"fr-MG", :"fr-ML",
      :"fr-MQ", :"fr-MR", :"fr-MU", :"fr-NC", :"fr-NE", :"fr-PF", :"fr-PM",
      :"fr-RE", :"fr-RW", :"fr-SC", :"fr-SN", :"fr-SY", :"fr-TD", :"fr-TG",
      :"fr-TN", :"fr-VU", :"fr-WF", :"fr-YT"
    ]

# `fallback`

Returns the immediate fallback locale for a
locale name. Follows the CLDR [TR35](https://unicode.org/reports/tr35/tr35.html#Bundle_vs_Item_Lookup)
resource bundle lookup algorithm.

This function is only intended to
return the fallback for the locales
defined by CLDR. It does not perform
any alias lookup or likely subtag
processing.

## Algorithm Summary

1. Decompose the locale name into language,
   script, territory and variant. CLDR locale
   names have no more than these four parts but
   usually have less.

2. Look for a locale in the following order:
   * language-script-territory
   * language-script
   * language-territory
   * language

3. At each stage in (2) resolve
   an alias in `parent_locales/1`

# `fallback_chain`

Returns the fallback chain for a
locale name. Follows the CLDR [TR35](https://unicode.org/reports/tr35/tr35.html#Bundle_vs_Item_Lookup)
resource bundle lookup algorithm.

This function is only intended to
return fallback chains for the locales
defined by CLDR. It does not perform
any alias lookup or likely subtag
processing.

The primary purpose for this function is
to support including fallback locales
in a backend configuration since both
RBNF and Subdivision data follows the
fallback chain.

## Algorithm Summary

1. Decompose the locale name into language,
   script, territory and variant. CLDR locale
   names have no more than these four parts but
   usually have less.

2. Look for a locale in the following order:
   * language-script-territory
   * language-script
   * language-territory
   * language

3. At each stage in (2) resolve
   an alias in `parent_locales/1`

# `get_precompile_number_formats`

Get the configured number formats that should be precompiled at application
compilation time.

# `gettext`

```elixir
@spec gettext(t() | map()) :: module() | nil
```

Return the configured `Gettext` module name or `nil`.

# `gettext_configured?`

```elixir
@spec gettext_configured?(t()) :: boolean() | nil
```

Returns true if a `Gettext` module is configured in Cldr and
the `Gettext` module is available.

## Example

    iex> test_config = TestBackend.Cldr.__cldr__(:config)
    iex> Cldr.Config.gettext_configured?(test_config)
    true

# `gettext_default_locale`

Return the default gettext locale for a CLDR
config.

# `grammatical_features`

Returns the CLDR grammatical features data
which is used with formatting units.

# `grammatical_gender`

Returns the CLDR grammatical gender data
which is used with formatting units.

# `include_module_docs?`

# `json_library`

Return the configured json lib

# `known_calendars`

Returns a list of strings representing the calendars known to `Cldr`.

## Example

    iex> Cldr.Config.known_calendars()
    [:buddhist, :chinese, :coptic, :dangi, :ethiopic, :ethiopic_amete_alem,
     :gregorian, :hebrew, :indian, :islamic, :islamic_civil, :islamic_rgsa,
     :islamic_tbla, :islamic_umalqura, :japanese, :persian, :roc]

# `known_currencies`

Returns a list of the currencies known in `Cldr` in
upcased atom format.

## Example

    iex> Cldr.Config.known_currencies()
    [:ADP, :AED, :AFA, :AFN, :ALK, :ALL, :AMD, :ANG, :AOA, :AOK, :AON, :AOR, :ARA,
     :ARL, :ARM, :ARP, :ARS, :ATS, :AUD, :AWG, :AZM, :AZN, :BAD, :BAM, :BAN, :BBD,
     :BDT, :BEC, :BEF, :BEL, :BGL, :BGM, :BGN, :BGO, :BHD, :BIF, :BMD, :BND, :BOB,
     :BOL, :BOP, :BOV, :BRB, :BRC, :BRE, :BRL, :BRN, :BRR, :BRZ, :BSD, :BTN, :BUK,
     :BWP, :BYB, :BYN, :BYR, :BZD, :CAD, :CDF, :CHE, :CHF, :CHW, :CLE, :CLF, :CLP,
     :CNH, :CNX, :CNY, :COP, :COU, :CRC, :CSD, :CSK, :CUC, :CUP, :CVE, :CYP, :CZK,
     :DDM, :DEM, :DJF, :DKK, :DOP, :DZD, :ECS, :ECV, :EEK, :EGP, :ERN, :ESA, :ESB,
     :ESP, :ETB, :EUR, :FIM, :FJD, :FKP, :FRF, :GBP, :GEK, :GEL, :GHC, :GHS, :GIP,
     :GMD, :GNF, :GNS, :GQE, :GRD, :GTQ, :GWE, :GWP, :GYD, :HKD, :HNL, :HRD, :HRK,
     :HTG, :HUF, :IDR, :IEP, :ILP, :ILR, :ILS, :INR, :IQD, :IRR, :ISJ, :ISK, :ITL,
     :JMD, :JOD, :JPY, :KES, :KGS, :KHR, :KMF, :KPW, :KRH, :KRO, :KRW, :KWD, :KYD,
     :KZT, :LAK, :LBP, :LKR, :LRD, :LSL, :LTL, :LTT, :LUC, :LUF, :LUL, :LVL, :LVR,
     :LYD, :MAD, :MAF, :MCF, :MDC, :MDL, :MGA, :MGF, :MKD, :MKN, :MLF, :MMK, :MNT,
     :MOP, :MRO, :MRU, :MTL, :MTP, :MUR, :MVP, :MVR, :MWK, :MXN, :MXP, :MXV, :MYR,
     :MZE, :MZM, :MZN, :NAD, :NGN, :NIC, :NIO, :NLG, :NOK, :NPR, :NZD, :OMR, :PAB,
     :PEI, :PEN, :PES, :PGK, :PHP, :PKR, :PLN, :PLZ, :PTE, :PYG, :QAR, :RHD, :ROL,
     :RON, :RSD, :RUB, :RUR, :RWF, :SAR, :SBD, :SCR, :SDD, :SDG, :SDP, :SEK, :SGD,
     :SHP, :SIT, :SKK, :SLE, :SLL, :SOS, :SRD, :SRG, :SSP, :STD, :STN, :SUR, :SVC,
     :SYP, :SZL, :THB, :TJR, :TJS, :TMM, :TMT, :TND, :TOP, :TPE, :TRL, :TRY, :TTD,
     :TWD, :TZS, :UAH, :UAK, :UGS, :UGX, :USD, :USN, :USS, :UYI, :UYP, :UYU, :UYW,
     :UZS, :VEB, :VED, :VEF, :VES, :VND, :VNN, :VUV, :WST, :XAF, :XAG, :XAU, :XBA,
     :XBB, :XBC, :XBD, :XCD, :XCG, :XDR, :XEU, :XFO, :XFU, :XOF, :XPD, :XPF, :XPT,
     :XRE, :XSU, :XTS, :XUA, :XXX, :YDD, :YER, :YUD, :YUM, :YUN, :YUR, :ZAL, :ZAR,
     :ZMK, :ZMW, :ZRN,:ZRZ, :ZWD, :ZWG, :ZWL, :ZWR]

# `known_gettext_locale_names`

```elixir
@spec known_gettext_locale_names(t()) :: [Cldr.Locale.locale_name()]
```

Return a list of the locales defined in `Gettext`.

Return a list of locales configured in `Gettext` or
`[]` if `Gettext` is not configured.

# `known_locale_name`

Returns either the locale name (if its known)
or `false` if the locale name is not known.

# `known_locale_names`

> This function is deprecated. Use Cldr.Locale.Loader.known_locale_names/1.

```elixir
@spec known_locale_names(t() | Cldr.backend()) :: [Cldr.Locale.locale_name()]
```

Returns a list of all locales that are configured and available
in the CLDR repository.

# `known_number_system_types`

Returns the number system types that
are known.

# `known_number_systems`

Returns a list of strings representing the number systems known to `Cldr`.

## Example

    iex> Cldr.Config.known_number_systems()
    [:adlm, :ahom, :arab, :arabext, :armn, :armnlow, :bali, :beng, :bhks, :brah,
    :cakm, :cham, :cyrl, :deva, :diak, :ethi, :fullwide, :gara, :geor, :gong,
    :gonm, :grek, :greklow, :gujr, :gukh, :guru, :hanidays, :hanidec, :hans,
    :hansfin, :hant, :hantfin, :hebr, :hmng, :hmnp, :java, :jpan, :jpanfin,
    :jpanyear, :kali, :kawi, :khmr, :knda, :krai, :lana, :lanatham, :laoo, :latn,
    :lepc, :limb, :mathbold, :mathdbl, :mathmono, :mathsanb, :mathsans, :mlym,
    :modi, :mong, :mroo, :mtei, :mymr, :mymrepka, :mymrpao, :mymrshan, :mymrtlng,
    :nagm, :newa, :nkoo, :olck, :onao, :orya, :osma, :outlined, :rohg, :roman,
    :romanlow, :saur, :segment, :shrd, :sind, :sinh, :sora, :sund, :sunu, :takr,
    :talu, :taml, :tamldec, :telu, :thai, :tibt, :tirh, :tnsa, :tols, :vaii, :wara,
    :wcho]

# `known_number_systems_like`

```elixir
@spec known_number_systems_like(Cldr.Locale.locale_name(), number_system(), t()) ::
  {:ok, list()} | {:error, {module(), String.t()}}
```

Returns locale and number systems that have the same digits and
separators as the supplied one.

Transliterating between locale & number systems is expensive.  To avoid
unnecessary transliteration we look for locale and number systems that have
the same digits and separators.  Typically we are comparing to locale "en"
and number system "latn" since this is what the number formatting routines use
as placeholders.

This function is intended for use at compile time only and is
used to help optimise the generation of transliteration functions.

# `known_rbnf_locale_name`

Returns either the locale name (if its known
and has an rbnf configuration)
or `false`.

# `known_rbnf_locale_names`

> This function is deprecated. Use Cldr.Locale.Loader.known_rbnf_locale_names/1.

```elixir
@spec known_rbnf_locale_names(t()) :: [Cldr.Locale.locale_name()]
```

Returns a list of all locales that have RBNF data and that are
configured and available in the CLDR repository.

# `known_territories`

Returns a list of atoms representing the territories known to `Cldr`.

## Example

    iex> Cldr.Config.known_territories()
    [:"001", :"002", :"003", :"005", :"009", :"011", :"013", :"014", :"015", :"017",
     :"018", :"019", :"021", :"029", :"030", :"034", :"035", :"039", :"053", :"054",
     :"057", :"061", :"142", :"143", :"145", :"150", :"151", :"154", :"155", :"202",
     :"419", :AC, :AD, :AE, :AF, :AG, :AI, :AL, :AM, :AO, :AQ, :AR, :AS, :AT, :AU,
     :AW, :AX, :AZ, :BA, :BB, :BD, :BE, :BF, :BG, :BH, :BI, :BJ, :BL, :BM, :BN, :BO,
     :BQ, :BR, :BS, :BT, :BV, :BW, :BY, :BZ, :CA, :CC, :CD, :CF, :CG, :CH, :CI, :CK,
     :CL, :CM, :CN, :CO, :CP, :CQ, :CR, :CU, :CV, :CW, :CX, :CY, :CZ, :DE, :DG, :DJ,
     :DK, :DM, :DO, :DZ, :EA, :EC, :EE, :EG, :EH, :ER, :ES, :ET, :EU, :EZ, :FI, :FJ,
     :FK, :FM, :FO, :FR, :GA, :GB, :GD, :GE, :GF, :GG, :GH, :GI, :GL, :GM, :GN, :GP,
     :GQ, :GR, :GS, :GT, :GU, :GW, :GY, :HK, :HM, :HN, :HR, :HT, :HU, :IC, :ID, :IE,
     :IL, :IM, :IN, :IO, :IQ, :IR, :IS, :IT, :JE, :JM, :JO, :JP, :KE, :KG, :KH, :KI,
     :KM, :KN, :KP, :KR, :KW, :KY, :KZ, :LA, :LB, :LC, :LI, :LK, :LR, :LS, :LT, :LU,
     :LV, :LY, :MA, :MC, :MD, :ME, :MF, :MG, :MH, :MK, :ML, :MM, :MN, :MO, :MP, :MQ,
     :MR, :MS, :MT, :MU, :MV, :MW, :MX, :MY, :MZ, :NA, :NC, :NE, :NF, :NG, :NI, :NL,
     :NO, :NP, :NR, :NU, :NZ, :OM, :PA, :PE, :PF, :PG, :PH, :PK, :PL, :PM, :PN, :PR,
     :PS, :PT, :PW, :PY, :QA, :QO, :RE, :RO, :RS, :RU, :RW, :SA, :SB, :SC, :SD, :SE,
     :SG, :SH, :SI, :SJ, :SK, :SL, :SM, :SN, :SO, :SR, :SS, :ST, :SV, :SX, :SY, :SZ,
     :TA, :TC, :TD, :TF, :TG, :TH, :TJ, :TK, :TL, :TM, :TN, :TO, :TR, :TT, :TV, :TW,
     :TZ, :UA, :UG, :UM, :UN, :US, :UY, :UZ, :VA, :VC, :VE, :VG, :VI, :VN, :VU, :WF,
     :WS, :XK, :YE, :YT, :ZA, :ZM, :ZW]

# `language_data`

Return the language data that maps
valid territories and scripts

# `language_matching`

Returns the language matching data

# `language_tag`

```elixir
@spec language_tag(Cldr.Locale.locale_name()) :: Cldr.LanguageTag.t() | no_return()
```

Return the saved language tag for the
given locale name.

# `language_tag_for_territory`

Return the mapping from a territory to a language tag.

This is used to derive a locale from a territory.

# `likely_subtags`

Returns the likely subtags map which maps a
locale string to %LaguageTag{} representing
the likely subtags for that locale string

# `locale_filename`

Returns the filename that contains the json representation
of a locale.

# `locale_name_from_posix`

Transforms a locale name from the Posix format to the Cldr format

# `locale_name_to_posix`

Transforms a locale name from the CLDR format to the Posix format

# `locale_path`

```elixir
@spec locale_path(Cldr.Locale.locale_name() | String.t(), Cldr.backend() | t()) ::
  {:ok, String.t()} | {:error, :not_found}
```

Returns the location of the json data for a `locale`

## Arguments

* `locale` is any locale returned from `Cldr.known_locale_names/1`

* `config` is any `t:Cldr.Config`

## Returns

* `{:ok, path}` or

* `{:error, :not_found}`

# `locale_path!`

```elixir
@spec locale_path!(String.t(), Cldr.backend() | t()) :: String.t() | no_return()
```

Returns the location of the json data for a `locale`

## Arguments

* `locale` is any locale returned from `Cldr.known_locale_names/1`

* `config` is any `t:Cldr.Config`

## Returns

* `path` or

* raises an exception

# `maybe_add_fallback_locales`

Add the fallback locales to a list of
configured locales

# `measurement_systems`

Return a list of measurement systems

# `merge_locales_with_default`

# `metazone_ids`

Return the mapping from short zone to metazone.

# `metazone_mapping`

Return the metazone mapping data.

# `metazones`

Return the metazone data.

# `normalize_plural_rules`

# `number_symbols_for`

Get the number symbol definitions
for a locale

# `number_symbols_for`

# `number_symbols_for!`

Get the number symbol definitions
for a locale or raises if an error

# `number_symbols_for!`

# `number_system_for`

```elixir
@spec number_system_for(Cldr.Locale.locale_name(), number_system(), t()) ::
  {:ok, map()} | {:error, {module(), String.t()}}
```

Returns the number system for a given
locale and number system name.

## Example

    iex> Cldr.Config.number_system_for(:th, :thai, %Cldr.Config{locales: ["th", "de"]})
    {:ok, %{digits: "๐๑๒๓๔๕๖๗๘๙", type: :numeric}}

# `number_system_names_for`

```elixir
@spec number_system_names_for(Cldr.Locale.locale_name(), t()) ::
  {:ok, [atom(), ...]} | {:error, {module(), String.t()}}
```

Returns the number system names for a locale

## Example

    iex> Cldr.Config.number_system_names_for(:th, %Cldr.Config{locales: ["en", "th"]})
    {:ok, [:latn, :thai]}

# `number_system_types_for`

Returns the number system types for a locale

# `number_systems_for`

```elixir
@spec number_systems_for(Cldr.Locale.locale_name(), t()) ::
  {:ok, map()} | {:error, {module(), String.t()}}
```

Returns the number systems for a locale

## Example

    iex> Cldr.Config.number_systems_for(:en, %Cldr.Config{locales: ["en", "de"]})
    {:ok, %{default: :latn, native: :latn}}

# `number_systems_for!`

```elixir
@spec number_systems_for!(Cldr.Locale.locale_name(), t()) :: map() | no_return()
```

Returns the number systems for a locale
or raises if there is an error

## Example

    iex> Cldr.Config.number_systems_for!(:de, %Cldr.Config{locales: ["en", "de"]})
    %{default: :latn, native: :latn}

# `parent_locales`

Returns a map of locale names to
its parent locale name.

Note that these mappings only exist
where the normal inheritance doesn't
apply.

# `plural_ranges`

Return a map of plural ranges

# `primary_zones`

Return the primary zones for territories.

# `raise_if_otp_app_not_loaded!`

# `requested_locale_names`

```elixir
@spec requested_locale_names(t()) :: [Cldr.Locale.locale_name()]
```

Returns a list of all configured locales.

The list contains locales configured both in `Gettext` and
specified in the mix.exs configuration file as well as the
default locale.

# `required_modules`

```elixir
@spec required_modules() :: [String.t()]
```

Identifies the top level keys in the consolidated locale file.

These keys represent difference dimensions of content in the CLDR
repository and serve three purposes:

1. To structure the content in the locale file

2. To provide a rudimentary way to validate that some json represents a
valid locale file

# `root_locale_name`

# `source_data_dir`

Return the directory where `Cldr` stores its source core data,

This directory should not be expected to be available
other than when developing Cldr since it points to a source
directory.

These are the json files that result from the normalization
of the original CLDR data.

# `split_currency_metadata`

# `system_name_from`

```elixir
@spec system_name_from(
  String.t(),
  Cldr.Locale.locale_name() | Cldr.LanguageTag.t(),
  t() | Cldr.backend()
) :: {:ok, atom()} | {:error, {module(), String.t()}}
```

Returns a number system name for a given locale and number system reference.

## Arguments

* `system_name` is any number system name returned by
  `Cldr.known_number_systems/0` or a number system type
  returned by `Cldr.known_number_system_types/1`

* `locale` is any valid locale name returned by `Cldr.known_locale_names/1`
  or a `Cldr.LanguageTag` struct returned by `Cldr.Locale.new!/2`

* `config` is a `Config.Cldr.t()` struct or a `Cldr.backend()` module

Number systems can be referenced in one of two ways:

* As a number system type such as `:default`, `:native`, `:traditional` and
  `:finance`. This allows references to a number system for a locale in a
  consistent fashion for a given use

* With the number system name directly, such as :latn, :arab or any name
  returned by `Cldr.known_number_systems/0`

This function dereferences the supplied `system_name` and returns the
actual system name.

## Examples

    iex> Cldr.Config.system_name_from(:default, :en, TestBackend.Cldr)
    {:ok, :latn}

    iex> Cldr.Config.system_name_from("latn", :en, TestBackend.Cldr)
    {:ok, :latn}

    iex> Cldr.Config.system_name_from(:native, :en, TestBackend.Cldr)
    {:ok, :latn}

    iex> Cldr.Config.system_name_from(:nope, :en, TestBackend.Cldr)
    {
      :error,
      {Cldr.UnknownNumberSystemError, "The number system :nope is unknown"}
    }

# `territories`

Returns a map of territory info for all territories
known to CLDR.

The territory information is independent of the
`ex_cldr` configuration.

## Example

    iex> Cldr.Config.territories()[:GB]
    %{
      currency: [GBP: %{from: ~D[1694-07-27]}],
      language_population: %{
        "ar" => %{population_percent: 0.3},
        "bn" => %{population_percent: 0.4},
        "cy" => %{population_percent: 1.3, official_status: "official_regional"},
        "de" => %{population_percent: 9},
        "en" => %{population_percent: 98, official_status: "official"},
        "en-Shaw" => %{population_percent: 0},
        "es" => %{population_percent: 8},
        "fr" => %{population_percent: 17},
        "ga" => %{population_percent: 0.15, official_status: "official_regional"},
        "gd" => %{
          population_percent: 0.11,
          official_status: "official_regional",
          writing_percent: 5
        },
        "gu" => %{population_percent: 2.9},
        "it" => %{population_percent: 0.2},
        "kw" => %{population_percent: 0.0029},
        "lt" => %{population_percent: 0.2},
        "pa" => %{population_percent: 3.6},
        "pi" => %{population_percent: 0.0002},
        "pl" => %{population_percent: 4},
        "pt" => %{population_percent: 0.2},
        "ro" => %{population_percent: 0.8},
        "sco" => %{population_percent: 2.5, writing_percent: 5},
        "so" => %{population_percent: 0.2},
        "ta" => %{population_percent: 3.2},
        "tr" => %{population_percent: 0.2},
        "ur" => %{population_percent: 3.5},
        "zh-Hant" => %{population_percent: 0.3}
      },
      population: 68459100,
      measurement_system: %{
        default: :uksystem,
        paper_size: :a4,
        temperature: :uksystem
      },
      gdp: 3700000000000,
      literacy_percent: 99
    }

# `territory`

```elixir
@spec territory(Cldr.Locale.territory_reference() | String.t()) ::
  %{} | {:error, {module(), String.t()}}
```

Get territory info for a specific territory.

* `territory` is a string, atom or language_tag representation
  of a territory code in the list returned by `Cldr.known_territories`

Returns:

* A map of the territory information or
* `{:error, reason}`

## Example

    iex> Cldr.Config.territory "au"
    %{
      currency: [AUD: %{from: ~D[1966-02-14]}],
      measurement_system: %{default: :metric, paper_size: :a4, temperature: :metric},
      language_population: %{
        "en" => %{population_percent: 96, official_status: "de_facto_official"},
        "hnj" => %{population_percent: 0.0082},
        "it" => %{population_percent: 1.9},
        "wbp" => %{population_percent: 0.0093},
        "zh-Hant" => %{population_percent: 2.1}
      },
      gdp: 1584000000000,
      literacy_percent: 99,
      population: 26768600
    }

    iex> Cldr.Config.territory "abc"
    {:error, {Cldr.UnknownTerritoryError, "The territory \"abc\" is unknown"}}

# `territory_codes`

Return a map of ISO 3166 Alpha-2 territory codes
to their alpha-3, FIPS and numeric values where
available

# `territory_containers`

Returns a map of territory containers

# `territory_containment`

Returns a map of territory containment

# `territory_currency_data`

```elixir
@spec territory_currency_data() :: map()
```

Returns the currency mapping data for
territories.

# `territory_info`

> This function is deprecated. Use Cldr.Config.territories/0.

# `territory_info`

> This function is deprecated. Use Cldr.Config.territories/1.

# `territory_subdivision_containment`

Return a mapping between a subdivision and its
containing parents

# `territory_subdivisions`

Return the territory subdivisions

# `timezones`

Get the canonical timezone data

# `unicode_script_to_subtag_mapping`

Returns a mapping from Unicode script names to the
respective subtag used in BCP 47 language tags.

# `units`

Returns unit conversion data,

## Example

    iex> Cldr.Config.units() |> get_in([:conversions, :quart])
    %{
      base_unit: :cubic_meter,
      factor: "0.000946352946",
      offset: 0,
      systems: [:ussystem]
    }

# `unknown_locale_names`

```elixir
@spec unknown_locale_names(t()) :: [Cldr.Locale.locale_name()]
```

Returns a list of all locales that are configured but not available
in the CLDR repository.

# `validity`

Return a map of validity data for a given
type.

The types are `:languages`, `:scripts`,
`:territories`, `:subdivisions`, `:variants`
`:units`, `:u`, and `:t`

# `version`

Returns the version string of the CLDR data repository

# `week_info`

> This function is deprecated. Use Cldr.Config.weeks/0.

# `weeks`

Returns the data that defines start and end of
calendar weeks, weekends and years

---

*Consult [api-reference.md](api-reference.md) for complete listing*
