Current Stage:
- 🚀 Stage 3
Implementation Progress:
Spec Text:
- Caridy Patiño (@caridy)
- Eric Ferraiuolo (@ericf)
- Alex Sexton (@SlexAxton)
- Daniel Ehrenberg (@littledan)
- Stefan Penner (@stefanpenner)
This proposal is based on the LDML spec, C.11 Language Plural Rules:
- Java:
Class PluralRules
let o = new Intl.PluralRules("en", {
type: "cardinal" // default type
});
console.log(o.select(0)); // "other"
console.log(o.select(1)); // "one"
console.log(o.select(2)); // "other"
Support for ordinals is also included:
let o = new Intl.PluralRules("en", {
type: "ordinal"
});
console.log(o.select(11)); // "one"
console.log(o.select(22)); // "two"
console.log(o.select(33)); // "few"
console.log(o.select(44)); // "other"
-
new Intl.PluralRules("en").format(1.02);
should produce"other"
- Bikeshed on Intl.PluralRules
- Spec
pluralCategories
resolution
npm install
npm run build
open index.html