Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

intl-locales-supported

formatjs261.7kBSD-3-Clausedeprecated1.8.12TypeScript support: included

bad publish

Utility to help you polyfill the Node.js runtime when the Intl APIs are missing, or if the built-in Intl is missing locale data that you need.

i18n, intl, internationalization, localization, globalization

readme

intl-locales-supported

Utility to help you determine if your runtime has modern Intl API & locales support. This specifically checks for Intl.NumberFormat, Intl.PluralRules & Intl.RelativeTimeFormat and is being used by react-intl.

npm Version size

Usage

const areIntlLocalesSupported = require('intl-locales-supported');

const localesMyAppSupports = [
  /* list locales here */
];

// Determine if the built-in `Intl` has the locale data we need.
if (
  !areIntlLocalesSupported(localesMyAppSupports, [
    Intl.PluralRules,
    Intl.RelativeTimeFormat,
  ])
) {
  // `Intl` exists, but it doesn't have the data we need, so load the
  // polyfill and replace the constructors we need with the polyfill's.
  require('@formatjs/intl-pluralrules/polyfill');
  require('@formatjs/intl-pluralrules/locale-data/de'); // Load de

  require('@formatjs/intl-relativetimeformat/polyfill');
  require('@formatjs/intl-relativetimeformat/locale-data/de'); // Load de
}

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.8.12 (2020-07-03)

Note: Version bump only for package intl-locales-supported

1.8.11 (2020-07-01)

Note: Version bump only for package intl-locales-supported

1.8.10 (2020-05-27)

Note: Version bump only for package intl-locales-supported

1.8.9 (2020-05-25)

Note: Version bump only for package intl-locales-supported

1.8.8 (2020-05-05)

Note: Version bump only for package intl-locales-supported

1.8.7 (2020-04-28)

Note: Version bump only for package intl-locales-supported

1.8.6 (2020-04-24)

Bug Fixes

  • eslint-plugin-formatjs: add missing dep (776390e)

1.8.5 (2020-04-14)

Bug Fixes

  • clean up tsbuildinfo before full build (c301ca0)

1.8.4 (2019-11-26)

Note: Version bump only for package intl-locales-supported

1.8.3 (2019-11-25)

Note: Version bump only for package intl-locales-supported

1.8.2 (2019-11-21)

Bug Fixes

  • @formatjs/intl-listformat: use api-extractor to combine d.ts (e8af68d)

1.8.1 (2019-11-20)

Note: Version bump only for package intl-locales-supported

1.8.0 (2019-10-30)

Features

1.7.0 (2019-10-30)

Features

1.6.0 (2019-10-01)

Features

  • @formatjs/intl-utils: add IE11-safe getCanonicalLocales, (b5f37c4), closes #200

1.5.0 (2019-09-20)

Features

  • intl-locales-supported: mark the package as side-effects free (03d2ad8)

1.4.8 (2019-09-13)

Bug Fixes

  • intl-locales-supported: Confirm all requested ctors are present (#174) (f720ba6)

1.4.7 (2019-09-03)

Note: Version bump only for package intl-locales-supported

1.4.6 (2019-09-03)

Note: Version bump only for package intl-locales-supported

1.4.5 (2019-08-12)

Bug Fixes

  • intl-locales-supported: lazily default constructors, fixes #151 (0cba7a6)

1.4.4 (2019-08-11)

Bug Fixes

  • generate lib instead of mjs (05e63b3)

1.4.3 (2019-08-06)

Bug Fixes

  • generate .mjs instead of lib (0c34ee4)

1.4.2 (2019-07-23)

Note: Version bump only for package intl-locales-supported

1.4.1 (2019-07-12)

Note: Version bump only for package intl-locales-supported

1.4.0 (2019-07-12)

Features

  • intl-messageformat-parser: add printer to print AST to string (ec0eaa2)

1.3.4 (2019-07-09)

Note: Version bump only for package intl-locales-supported

1.3.3 (2019-07-08)

Note: Version bump only for package intl-locales-supported

1.3.2 (2019-06-28)

Bug Fixes

  • intl-locales-supported: update README (5c7daab)

1.3.1 (2019-07-02)

Bug Fixes

  • intl-locales-supported: Fix license identifier (#109) (e50c762)

1.3.0 (2019-06-27)

Features

  • intl-messageformat: allow passing in formatters (#107) (3605693)

1.2.1 (2019-06-26)

Note: Version bump only for package intl-locales-supported

1.2.0 (2019-06-27)

Features

1.1.2 (2019-06-18)

Note: Version bump only for package intl-locales-supported

1.1.1 (2019-06-18)

Note: Version bump only for package intl-locales-supported

1.1.0 (2019-06-12)

Features

  • intl-locales-supported: make constructors to check configurable (21158b7), closes #87

1.0.10 (2019-06-03)

Note: Version bump only for package intl-locales-supported

1.0.9 (2019-06-03)

Note: Version bump only for package intl-locales-supported

1.0.8 (2019-06-03)

Note: Version bump only for package intl-locales-supported

1.0.7 (2019-06-03)

Note: Version bump only for package intl-locales-supported

1.0.6 (2019-05-31)

Note: Version bump only for package intl-locales-supported

1.0.5 (2019-05-28)

Note: Version bump only for package intl-locales-supported

1.0.4 (2019-05-28)

Note: Version bump only for package intl-locales-supported

1.0.3 (2019-05-28)

Note: Version bump only for package intl-locales-supported

1.0.2 (2019-05-28)