Intl.getCanonicalLocales

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

npm Version size

Installation

npm install @formatjs/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-getcanonicallocales/polyfill';

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

To use this as a ponyfill:

import getCanonicalLocales from '@formatjs/intl-getcanonicallocales';

Tests

This library is test262-compliant.