Cldr v0.3.0 API Reference

Modules

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

Provides the functions to manage the Cldr configuration

Consolidates all locale-specific information from the CLDR repository into one locale-specific file

Defines a currency structure and a set of functions to manage the validity of a currency code and to return metadata for currencies

Functions to support the string formatting of relative time/datetime numbers. This allows for the formatting of numbers (as integers, floats, Dates or DateTimes) as “ago” or “in” with an appropriate time unit. For example, “2 days ago” or “in 10 seconds”

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

Cldr incudes patterns that enable list to be catenated together to form a grammatically correct language construct for a given locale

Parse and process locale json as defined by Unicode

Helper functions for transforming maps, keys and values

Math helper functions for number formatting

Takes the currency part of the locale map and transforms the formats into a more easily processable structure that is then stored in map managed by Cldr.Locale

Takes the list part of the locale map and transforms the formats into a more easily processable structure that is then stored in map managed by Cldr.Locale

Takes the list part of the locale map and transforms the formats into a more easily processable structure that is then stored in map managed by Cldr.Locale

Takes the number part of the locale map and transforms the formats into a more easily processable structure that is then stored in map managed by Cldr.Locale

Takes the number system part of the locale map and transforms the formats into a more easily processable structure that is then stored in map managed by Cldr.Locale

Takes the rbnf part of the locale map and transforms the formats into a more easily processable structure that is then stored in map managed by Cldr.Locale

Takes the units part of the locale map and transforms the formats into a more easily processable structure that is then stored in map managed by Cldr.Locale

The main public API for the formatting of numbers and currencies

Implements cardinal plural rules for numbers

Functions to manage the collection of number patterns defined in Cldr

Compiles number patterns with a lexer/parser into patterns for fast runtime interpretation

Number formatter for the :currency :long format

Formats a number according to a locale-specific predefined format or a user-defined format

Formats a number according to the locale-specific :short formats

Implements ordinal plural rules for numbers

Macro to define plural rule methods on a module

Generate functions from CLDR plural rules that can be used to determine which pularization rule to be used for a given number

Tranformations on the parse tree returned from parsing plural rules

String helper functions

Functions to manage the symbol definitions for a locale and number system

Functions to manage number systems which describe the numbering characteristics for a locale

Transliteration for digits and separators

Functions to implement Rules Based Number Formatting (rbnf)

Rules Base Number Formatting Configuration management

Functions to implement the number system rule-based-number-format rules of CLDR

Functions to implement the ordinal rule-based-number-format rules of CLDR

Macro to define the interpreter for the compiled RBNF rules specific to a rule group (Ordinal, Spellout, NumberingSystem)

Tokenizer and Parser for RBNF rules

Functions to implement the spellout rule-based-number-format rules of CLDR

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

Supports the CLDR Units definitions which provide for the localization of many unit types

Mix task to consolidate the cldr data into a set of files, one file per CLDR locale

Installs the cldr core data and configured locales into the application. By default it installs into the ./priv/cldr directory

Exceptions

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 currncy 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 unit that is not known in Cldr