Cldr.get_locale
You're seeing just the function
get_locale
, go back to Cldr module for more information.
Return the Cldr
locale for the
current process.
Note that the locale is set per-process. If the locale is not set for the given process then:
Return the global default locale which is defined under the
:ex_cldr
key inconfig.exs
Or the system-wide default locale which is "en-001"
Note that if there is no locale set for the current process then an error is not returned - a default locale will be returned per the rules above.
Example
iex> Cldr.put_locale(TestBackend.Cldr.Locale.new!("pl"))
iex> Cldr.get_locale()
%Cldr.LanguageTag{
backend: TestBackend.Cldr,
canonical_locale_name: "pl",
cldr_locale_name: "pl",
extensions: %{},
language: "pl",
locale: %{},
private_use: [],
rbnf_locale_name: "pl",
territory: :PL,
requested_locale_name: "pl",
script: :Latn,
transform: %{},
language_variants: []
}