Cldr v0.1.0 Cldr
Cldr provides functions to localise numbers, currencies, lists and dates/times to an appropriate locale as defined by the CLDR data maintained by the ICU.
The most commonly used functions are:
Cldr.Number.to_string/2
for formatting numbersCldr.Currency.to_string/2
for formatting currenciesCldr.List.to_string/2
for formatting lists
Summary
Functions
Returns a list of all the locales defined in the CLDR repository
Returns the directory path name where the CLDR json data is kept
Returns the default locale
name
Return the current locale to be used for Cldr
functions that
take an optional locale parameter for which a locale is not supplied
Returns a boolean indicating if the specified locale is configured and available in Cldr
Returns a list of the known locales
Returns a boolean indicating if the specified locale is available in CLDR
Returns a list of all requested locales
Set the current locale to be used for Cldr
functions that
take an optional locale parameter for which a locale is not supplied
Returns a list of the locales that are configured, but not known in CLDR
Returns the version of the CLDR repository as a tuple
Functions
Returns a list of all the locales defined in the CLDR repository.
Note that not necessarily all of these locales are available since functions are only generated for configured locales which is most cases will be a subset of locales defined in CLDR.
See also: requested_locales/0
and known_locales/0
Return the current locale to be used for Cldr
functions that
take an optional locale parameter for which a locale is not supplied.
Returns a boolean indicating if the specified locale is configured and available in Cldr.
Examples
iex> Cldr.known_locale?("en")
true
iex> Cldr.known_locale?("!!")
false
Returns a list of the known locales.
Known locales are those locales which
are the subset of all CLDR locales that
have been configured for use either
directly in the config.exs
file or
in Gettext
.
Returns a boolean indicating if the specified locale is available in CLDR.
The return value depends on whether the locale is
defined in the CLDR repository. It does not necessarily
mean the locale is configured for Cldr. See also
Cldr.known_locale?/1
.
Examples
iex> Cldr.locale_exists? "en-AU"
true
iex> Cldr.locale_exists? "en-SA"
false
Returns a list of all requested locales.
The list is the combination of configured locales,
Gettext
locales and the default locale.
See also known_locales/0
and all_locales/0
Set the current locale to be used for Cldr
functions that
take an optional locale parameter for which a locale is not supplied.
Returns a list of the locales that are configured, but not known in CLDR.
Since we check at compile time for any unknown locales and raise and exception this function should always return an empty list.