make-plural provides JavaScript functions that implement the Unicode CLDR pluralization rules for approximately 220 languages. It handles both cardinal (e.g., 'one book') and ordinal (e.g., '1st book') pluralization categories. As of version 8.1.0, the library is actively maintained with regular updates to support the latest CLDR versions, ensuring accuracy for new locales and rule changes. Key differentiators include its pre-compiled, runtime-dependency-free functions, optimized for tree-shaking with ES modules, which can result in very small bundle sizes when only specific locales are imported. It is used internally by the `intl-pluralrules` polyfill and offers companion packages `make-plural-cli` and `make-plural-compiler` for custom build generation. The project maintains a steady release cadence, often tied to new CLDR versions or feature enhancements like compact notation support, ensuring current and accurate pluralization logic.
npm install make-pluralVerified import paths — ran on the pinned version, not inferred.
Demonstrates cardinal and ordinal pluralization for English and French, including specific locale imports for tree-shaking and accessing plural categories for different languages, highlighting locale key transformations.
Migrate all imports from `require('make-plural')` to `import { ... } from 'make-plural'` syntax and ensure your build environment supports ES modules.Review the new license for compliance. For environments not supporting ES6 (e.g., IE 11), ensure your build process includes transpilation (e.g., Babel) for ES6+ syntax.
Refactor your imports to target specific locale functions using named imports to allow bundlers to remove unused code.
When accessing the `pt-PT` locale as a property from exported objects, use the underscore-separated `pt_PT` identifier.
Be aware that not all locales supported for cardinal plurals will have corresponding ordinal pluralization rules via `make-plural/ordinals`.
Update your code to use ES module `import { en } from 'make-plural'` syntax and ensure your build system supports ES modules.Configure your build process (e.g., Babel) to transpile ES6+ syntax to a compatible target for your deployment environment.
Use the transformed identifier `pt_PT` (with an underscore) when accessing the Portuguese (Portugal) locale, e.g., `Categories.pt_PT`.
Refactor your imports to use named imports for specific locales, e.g., `import { en, fr } from 'make-plural/cardinals'`.No dependency data recorded yet.