intl-locales-supported

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.

bad publish
Last updated 4 years ago by longlho .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install intl-locales-supported 
SYNC missed versions from official npm registry.

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
}

Current Tags

  • 1.8.12                                ...           latest (4 years ago)

42 Versions

  • 1.8.12 [deprecated]           ...           4 years ago
  • 1.8.11                                ...           4 years ago
  • 1.8.10                                ...           4 years ago
  • 1.8.9                                ...           4 years ago
  • 1.8.8                                ...           4 years ago
  • 1.8.7                                ...           4 years ago
  • 1.8.6                                ...           4 years ago
  • 1.8.5                                ...           4 years ago
  • 1.8.4                                ...           5 years ago
  • 1.8.3                                ...           5 years ago
  • 1.8.2                                ...           5 years ago
  • 1.8.1                                ...           5 years ago
  • 1.8.0                                ...           5 years ago
  • 1.6.0                                ...           5 years ago
  • 1.5.0                                ...           5 years ago
  • 1.4.8                                ...           5 years ago
  • 1.4.7                                ...           5 years ago
  • 1.4.6                                ...           5 years ago
  • 1.4.5                                ...           5 years ago
  • 1.4.4                                ...           5 years ago
  • 1.4.3                                ...           5 years ago
  • 1.4.2                                ...           5 years ago
  • 1.4.0                                ...           5 years ago
  • 1.3.4                                ...           5 years ago
  • 1.3.3                                ...           5 years ago
  • 1.3.2                                ...           5 years ago
  • 1.3.1                                ...           5 years ago
  • 1.3.0                                ...           5 years ago
  • 1.2.1                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.10                                ...           5 years ago
  • 1.0.9                                ...           5 years ago
  • 1.0.8                                ...           5 years ago
  • 1.0.6                                ...           5 years ago
  • 1.0.5                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           9 years ago
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |