Intl.Locale

A spec-compliant polyfill/ponyfill for Intl.Locale tested by the official ECMAScript Conformance test suite

npm Version size

Installation

npm install @formatjs/intl-locale

Requirements

If you're supporting IE11-, this requires Intl.getCanonicalLocales.

Usage

To use the polyfill, just import it to make sure that a fully functional Intl.Locale is available in your environment:

import '@formatjs/intl-locale/polyfill';

If Intl.Locale already exists, the polyfill will not be loaded.

To use this as a ponyfill:

import IntlLocale from '@formatjs/intl-locale';

Tests

This library is test262-compliant.