Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
plurals-cldr
Advanced tools
Key benefits:
cardinal
and ordinal
forms support.node.js:
$ npm install plurals-cldr
browser:
$ bower install plurals-cldr
make clean
make generate
Returns form name for given number. Number can be passed as string to keep
tailing decimal zeros. If locale not supported, returns null
.
var plural = require('plural-cldr');
// Get cardinal form name
//
// Params:
//
// - locale
// - number (Number|String)
//
plural('ru', 0) // -> 'many'
plural('ru', 1) // -> 'one'
plural('ru', 2) // -> 'few'
plural('ru', 19) // -> 'many'
plural('ru', 0.5) // -> 'other'
Returns array of available forms for specified locale. If locale not supported,
returns null
.
Returns index of form for specified locale. That's convenient, if you wish to implement lookup from compact ordered list, like babelfish does.
If locale not supported, function returns -1
.
Order of forms is the same for all languages: zero
, one
, two
, few
,
many
, other
. Remove unavailable forms, and you will get indexes of each.
The same as above, but for ordinal forms.
Mit.
FAQs
Plurals support, generated from CLDR.
The npm package plurals-cldr receives a total of 49,845 weekly downloads. As such, plurals-cldr popularity was classified as popular.
We found that plurals-cldr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.