Skip to content

YGGverse/plurify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plurify

Build Documentation crates.io

Pluralize words in different locales

Install

cargo add plurify

Usage

use plurify::ns;

let en = &["cat", "cats", "cats"];
let uk = &["кіт", "кота", "котів"];

assert_eq!(ns(1, en), "cat");
assert_eq!(ns(2, en), "cats");
assert_eq!(ns(5, en), "cats");

assert_eq!(ns(1, uk), "кіт");
assert_eq!(ns(2, uk), "кота");
assert_eq!(ns(5, uk), "котів");