JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 314936
  • Score
    100M100P100Q179368F
  • License ISC

Intl.PluralRules polyfill

Package Exports

  • intl-pluralrules

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (intl-pluralrules) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

intl-pluralrules

A polyfill for Intl.PluralRules

Installation

npm install intl-pluralrules

Usage

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

import 'intl-polyfill'

If Intl.PluralRules already exists, the polyfill will not be loaded. The implementation is itself available as intl-polyfill/plural-rules, if e.g. you'd prefer using it without polyfilling your Intl object.

This version mostly follows the published spec, with these difference:

  • The prototype.select() input is not forced to number, so for locales like English the correct plural rule is returned for '1.0' input. On the other hand, the minimum/mamximum digits options are ignored.
  • Only a "best-fit" locale matcher is supported.