Skip to main content
Version: 1.4.1

CLDR

A CLDR instance is an object that has been bound to a locale, and contains functionality grouped into several namespaces.

  • CLDR.Calendars
    • Creating dates in various calendars, formatting dates, relative times, time intervals, field of greatest difference
  • CLDR.General
    • Information about the current language bundle, locale, a method for resolving language tags
    • Formatting lists, display names for regions, scripts, locale character and line order
  • CLDR.Numbers
    • Formatting decimal numbers and currencies, plural categories for cardinal and ordinal numbers, currency info
  • CLDR.Units
    • Formatting unit quantities and unit sequences, getting unit display names

In order to make use of any localized functionality you need to obtain a CLDR instance from the framework.

Synchronous:

const cldr: CLDR = framework.get('en');
// .. do something with cldr instance

Asynchronous:

framework.getAsync('en').then((cldr: CLDR) => {
// .. do something with cldr instance
});