1.0.17 • Published 1 year ago
@os-team/plural-forms v1.0.17
@os-team/plural-forms

Declines nouns in the plural form. English and Russian languages are supported.
Usage
Install the package using the following command:
yarn add @os-team/plural-formsExample 1. English language
const years = 21;
const yearsPluralForm = pluralForms({
language: 'en',
forms: ['year', 'years'],
number: years,
});
console.log(`${years} ${yearsPluralForm}`); // 21 yearsExample 2. Russian language
const years = 21;
const yearsPluralForm = pluralForms({
language: 'ru',
forms: ['год', 'года', 'лет'],
number: years,
});
console.log(`${years} ${yearsPluralForm}`); // 21 год