# pluralizers

> Repository of localized pluralization functions

Latest version **0.1.7** (published 2017-11-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install pluralizers
pnpm add pluralizers
yarn add pluralizers
bun add pluralizers
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2017-11-16 |
| First published | 2014-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Martin Andert |
| Maintainers | martinandert |
| Keywords | localization, translation, translate, localize, plural, pluralization, pluralize, i18n, l10n |

## Links

- npm: https://www.npmjs.com/package/pluralizers
- Repository: https://github.com/martinandert/pluralizers
- Issues: https://github.com/martinandert/pluralizers/issues
- npm.io page: https://npm.io/package/pluralizers

## Alternatives

- [messageformat](https://npm.io/package/messageformat.md) — 329.7K weekly downloads
- [@mintlify/scraping](https://npm.io/package/@mintlify/scraping.md) — 294.8K weekly downloads
- [@mintlify/previewing](https://npm.io/package/@mintlify/previewing.md) — 209.5K weekly downloads
- [@mintlify/prebuild](https://npm.io/package/@mintlify/prebuild.md) — 209.5K weekly downloads
- [@mintlify/link-rot](https://npm.io/package/@mintlify/link-rot.md) — 206.3K weekly downloads

## Recent versions

- 0.1.7 (latest) — 2017-11-16
- 0.1.6 — 2017-06-16
- 0.1.5 — 2016-11-08
- 0.1.4 — 2016-09-28
- 0.1.3 — 2016-03-01
- 0.1.2 — 2016-03-01
- 0.1.1 — 2014-12-11
- 0.1.0 — 2014-02-21

## README

# pluralizers

Repository of localized pluralization functions. Usable in Node.js or in the browser.


## Installation

Install via npm:

```bash
% npm install pluralizers
```

## Usage

The default locale is `en` (English). Thus, a `require('pluralizers')` implicitly does `require('pluralizers/en')`.

```js
var sprintf   = require('sprintf').sprintf;
var pluralize = require('pluralizers');

var entry = { zero: 'no items', one: 'one item', other: '%(count)s items' };

pluralize(entry, 0)   // => 'no items'
pluralize(entry, 1)   // => 'one item'
pluralize(entry, 2)   // => '%(count)s items'

sprintf(pluralize(entry, 42), { count: 42 })   // => '42 items'
```

You can fetch a different localization by requiring a specific locale:

```js
var pluralize = require('pluralizers/de');
```

English ([en](en.js)), Dutch ([nl](nl.js)), German ([de](de.js)), Brazilian Portuguese ([pt-br](pt-br.js)), Russian ([ru](ru.js)) and Spanish ([es](es.js)) are currently the only supported locales. Pull requests welcome.


## Contributing

Here's a quick guide:

1. Fork the repo and `make install`.

2. Run the tests. We only take pull requests with passing tests, and it's great to know that you have a clean slate: `make test`.

3. 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!

4. Make the test pass.

5. Push to your fork and submit a pull request.


## Licence

Released under The MIT License.

---
_Source: https://npm.io/package/pluralizers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
