cyrillic-inflector

1.2.0 • Public • Published

cyrillic-inflector Build Status

cyrillic inflector (count, one, zero, some, many)

import inflect from 'cyrillic-inflector';
 
inflect(0, { zero: 'no calls', one: '{} call' }) // --> no calls
 
const infl = inflect({
  zero: 'Файлы не загружены',
  one: 'Загружен {} файл',
  some: 'Загружено {} файла',
  many: 'Загружено {} файлов'
});
test('complex zero', t => {
  t.is(infl(0), 'Файлы не загружены');
});
test('complex one', t => {
  t.is(infl(31), 'Загружен 31 файл');
});
test('complex some', t => {
  t.is(infl(5564), 'Загружено 5564 файла');
});
test('complex many', t => {
  t.is(infl(100500), 'Загружено 100500 файлов');
});

TODO

  • multiple variables support
  • genders
  • find alternative solutions
    • automatic inflector (generate suffixes automatically)

alternatives

Readme

Keywords

none

Package Sidebar

Install

npm i cyrillic-inflector

Weekly Downloads

2

Version

1.2.0

License

MIT

Unpacked Size

6.74 kB

Total Files

7

Last publish

Collaborators

  • invntrm