2 releases

0.1.1 Dec 18, 2024
0.1.0 Dec 18, 2024

#105 in Internationalization (i18n)

Download history 242/week @ 2024-12-15 16/week @ 2024-12-22

258 downloads per month
Used in yoda

MIT license

3KB

plurify

Build

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), "котів");

No runtime deps