2 releases
0.1.1 | Dec 18, 2024 |
---|---|
0.1.0 | Dec 18, 2024 |
#105 in Internationalization (i18n)
258 downloads per month
Used in yoda
3KB
plurify
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), "котів");