3 unstable releases
new 0.2.0 | Jan 28, 2025 |
---|---|
0.1.1 | Dec 18, 2024 |
0.1.0 | Dec 18, 2024 |
#134 in Internationalization (i18n)
102 downloads per month
Used in yoda
4KB
plurify
Pluralize words in different locales
Install
cargo add plurify
Usage
use plurify::*;
let en = &["cat", "cats", "cats"];
let uk = &["кіт", "кота", "котів"];
assert_eq!(1.plurify(en), "cat");
assert_eq!(2.plurify(en), "cats");
assert_eq!(5.plurify(en), "cats");
assert_eq!(1.plurify(uk), "кіт");
assert_eq!(2.plurify(uk), "кота");
assert_eq!(5.plurify(uk), "котів");