Cldr.known_locale_name
You're seeing just the function
known_locale_name
, go back to Cldr module for more information.
Specs
known_locale_name(Cldr.Locale.locale_name(), backend()) :: String.t() | nil
Returns either the locale_name
or false
based upon
whether the locale name is configured in Cldr
.
This is helpful when building a list of or
expressions
to return the first known locale name from a list.
Arguments
locale
is any valid locale name returned byCldr.known_locale_names/1
backend
is any module that includesuse Cldr
and therefore is aCldr
backend module. The default isCldr.default_backend/0
. Note thatCldr.default_backend/0
will raise an exception if no:default_backend
is configured under the:ex_cldr
key inconfig.exs
.
Examples
iex> Cldr.known_locale_name("en-AU", TestBackend.Cldr)
"en-AU"
iex> Cldr.known_locale_name("en-SA", TestBackend.Cldr)
nil