# Intl

The ECMAScript Internationalization API uses the Intl object as a namespace for providing language-sensitive features such as string comparison, number formatting, and date and time formatting. The Intl object contains a range of constructors and functions that can be used for this purpose, including functionality that is common to both internationalization constructors and other language-sensitive functions.

## Constructor properties

[Intl.Collator()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator)
Constructor for collators, which are objects that enable language-sensitive string comparison.

[Intl.DateTimeFormat()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat)
Constructor for objects that enable language-sensitive date and time formatting.

[Intl.DisplayNames()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames)
Constructor for objects that enable the consistent translation of language, region, and script display names.

[Intl.ListFormat()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat)
Constructor for objects that enable language-sensitive list formatting.

[Intl.Locale()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/Locale)
Constructor for objects that represents a Unicode locale identifier.

[Intl.NumberFormat()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat)
Constructor for objects that enable language-sensitive number formatting.

[Intl.PluralRules()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/PluralRules)
Constructor for objects that enable plural-sensitive formatting and language-specific rules for plurals.

[Intl.RelativeTimeFormat()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat)
Constructor for objects that enable language-sensitive relative time formatting.

[Intl.Segmenter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/Segmenter)
Constructor for objects that enable locale-sensitive text segmentation.

## Static methods

[Intl.getCanonicalLocales()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales)
Returns canonical locale names.

[Intl.supportedValuesOf()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf)
Returns a sorted array containing the supported unique calendar, collation, currency, numbering systems, or unit values supported by the implementation.

## Examples

Formatting dates and numbers
You can use Intl to format dates and numbers in a form that's conventional for a specific language and region:

```js
    const count = 26254.39;
    const date = new Date("2012-05-24");
    
    function log(locale) {
      console.log(
        `${new Intl.DateTimeFormat(locale).format(date)} ${new Intl.NumberFormat(
          locale,
        ).format(count)}`,
      );
    }
    
    log("en-US"); // 5/24/2012 26,254.39
    
    log("de-DE"); // 24.5.2012 26.254,39
```

For more information on [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) visit MDN Web Docs.