mirror of
https://github.com/YGGverse/plurify.git
synced 2026-03-31 17:15:36 +00:00
Pluralize words in different locales
https://crates.io/crates/plurify
| .github/workflows | ||
| src | ||
| tests | ||
| .gitignore | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
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), "котів");