1.0.12 • Published 1 year ago
@os-team/plural-forms v1.0.12
@os-team/plural-forms
![npm.io BundlePhobia](https://img.shields.io/bundlephobia/minzip/@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-forms
Example 1. English language
const years = 21;
const yearsPluralForm = pluralForms({
language: 'en',
forms: ['year', 'years'],
number: years,
});
console.log(`${years} ${yearsPluralForm}`); // 21 years
Example 2. Russian language
const years = 21;
const yearsPluralForm = pluralForms({
language: 'ru',
forms: ['год', 'года', 'лет'],
number: years,
});
console.log(`${years} ${yearsPluralForm}`); // 21 год