Cldr v0.0.14 Cldr.Rbnf.Config

Rules Base Number Formatting Configuration management.

During the process of consolidating the various CLDR XML files into a standard format that is easily digestible for Cldr, these functions are used to do the parsing an normalising of RBNF data.

Note that many of the functions in this module rely on having the raw XML RBNF files from the CLDR repository. The repository can be installed by running:

mix cldr.download

Unless you are interested in the muysteries of how the repository is put together this is not recommended.

Summary

Functions

Returns the rbnf rules for a locale or {:error, :rbnf_file_not_found}

Returns the list of locales that is the intersection of Cldr.known_locales/0 and Cldr.Rbnf.rbnf_locales/0

Returns a list of the locales for which there is an rbnf rule set

Functions

for_locale(locale)
for_locale(Locale.t) :: %{} | {:error, :rbnf_file_not_found}

Returns the rbnf rules for a locale or {:error, :rbnf_file_not_found}

  • locale is any locale returned by Rbnf.known_locales/0.

Note that for_locale/1 does not raise if the locale does not exist like the majority of Cldr. This is by design since the set of locales that have rbnf rules is substantially less than the set of locales supported by Cldr.

known_locales()

Returns the list of locales that is the intersection of Cldr.known_locales/0 and Cldr.Rbnf.rbnf_locales/0

This list is therefore the set of known locales for which there are rbnf rules defined.

rbnf_dir()
rbnf_dir() :: String.t
rbnf_locales()
rbnf_locales() :: [String.t] | []

Returns a list of the locales for which there is an rbnf rule set

Relies on the presence of downloaded CLDR data. This can be achieved by runnuing mix cldr.download. This function is usefully primarily to a Cldr library developer.