Cldr v1.3.2 API Reference

Modules

Cldr provides the core functions to retrieve and manage the CLDR data that supports formatting and localisation

Tokenizer and parser for HTTP Accept-Language header values as defined in rfc2616

Provides the functions to manage the Cldr configuration

Abstract representation of number (integer, float, Decimal) in tuple form and functions for transformations on number parts

Implements a Gettext-compatible module but using Cldr locales. Its an example only

Defines a Plural module for Gettext that uses the Cldr plural rules

Provides functions for installing locales

Represents a language tag as defined in rfc5646 with extensions “u” and “t” as defined in BCP 47

Parses a CLDR language tag (also referred to as locale string)

Functions to parse and normalize locale names into a structure locale represented by a Cldr.LanguageTag

Functions for transforming maps, keys and values

Math helper functions for number formatting

Implements cardinal plural rules for numbers

Implements ordinal plural rules for numbers

Macro to define plural rule methods on a module

Function to tokenize and parse a plural rule

Parses the accept-language header if one is available and sets conn.private[:cldr_locale] accordingly. The locale can be later retrieved by Cldr.Plug.AcceptLanguage.get_cldr_locale/1

Sets the Cldr and/or Gettext locales derived from the accept-language header, a query parameter, a url parameter, a body parameter or the session

Rules Base Number Formatting Configuration management

Functions that operate on a String.t that are not provided in the standard lib

Compiles substituation formats that are of the form “{0} something {1}” into a token list that allows for more efficient parameter substituation at runtime

Exceptions

Exception raised when there no valid language tag in an Accept-Language header

Exception raised when there is an error in the compiling of a number format

Exception raised when there is an error in the formatting of a number/list/

Exception raised when there is an invalid date format type

Exception raised when there is an invalid datetime format type

Exception raised when there is an a parse error in a language tag

Exception raised when there is an invalid time format type

Exception raised when no configured locale matches the provided “Accept-Language” header

Exception raised when there is no RBNF for a locale

Exception raised when an attempt is made to use a calendar that is not known. in Cldr

Exception raised when there is an invalid currency code

Exception raised when an attempt is made to use a locale that is not configured in Cldr. Cldr.known_locales/0 returns the locale names known to Cldr

Exception raised when an attempt is made to use a locale not configured in Cldr. Cldr.known_locales/0 returns the locale names known to Cldr

Exception raised when an attempt is made to use a number system that is not known in Cldr. Cldr.Number.number_system_names/0 returns the number system names known to Cldr

Exception raised when an attempt is made to use a number system type that is not known in Cldr. Cldr.Number.number_system_types/0 returns the number system types known to Cldr

Exception raised when there are no plural rules for a locale or language

Exception raised when there is an invalid territory code

Exception raised when an attempt is made to use a unit that is not known. in Cldr