Repository of localized pluralization functions. Usable in Node.js or in the browser.
Install via npm:
% npm install pluralizers
The default locale is
en (English). Thus, a
require('pluralizers') implicitly does
var sprintf = sprintf;var pluralize = ;var entry = zero: 'no items' one: 'one item' other: '%(count)s items' ;// => 'no items'// => 'one item'// => '%(count)s items'// => '42 items'
You can fetch a different localization by requiring a specific locale:
var pluralize = ;
Here's a quick guide:
Fork the repo and
Run the tests. We only take pull requests with passing tests, and it's great to know that you have a clean slate:
Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or are fixing a bug, we need a test!
Make the test pass.
Push to your fork and submit a pull request.
Released under The MIT License.