Cldr.validate_gettext_locale
You're seeing just the function
validate_gettext_locale
, go back to Cldr module for more information.
Link to this function
validate_gettext_locale(locale_name, backend \\ default_backend!())
View SourceSpecs
validate_gettext_locale( Cldr.Locale.locale_name() | Cldr.LanguageTag.t(), backend() ) :: {:ok, Cldr.LanguageTag.t()} | {:error, {module(), String.t()}}
Normalise and validate a gettext locale name.
Arguments
locale_name
is any valid locale name returned byCldr.known_locale_names/1
or aCldr.LanguageTag
struct returned byCldr.Locale.new!/2
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
.
Returns
{:ok, language_tag}
{:error, reason}