i18n-ru
v1.0.4
Published
i18n plugin for Russian city names
Downloads
95
Maintainers
Readme
i18n-ru
i18n-ru is a js plugin for internationalization of nouns in Russian language.
Installation
Use the package manager npm to install i18n-ru.
npm i -D i18n-ru
Usage
import toDeclension from 'i18n-ru';
toDeclention is a function that takes two arguments: case(string) and word(string) and return declentioned word.
Cases supported: 'vinit' and 'genitive'.
Example
toDeclension('vinit', 'Верхняя Пышма'); // Верхнюю Пышму
toDeclension('genitive', 'Верхняя Пышма'); // Верхней Пышмы
React Example
render() {
return (
<p>{toDeclension('genitive', 'Верхняя Пышма')}</p>
);
}
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.