mirror of
https://github.com/YGGverse/plurify.git
synced 2026-03-31 17:15:36 +00:00
initial commit
This commit is contained in:
parent
4ccf763a0e
commit
4f016e2ae0
6 changed files with 114 additions and 1 deletions
28
README.md
28
README.md
|
|
@ -1,2 +1,28 @@
|
|||
# plurify
|
||||
Library to pluralize words
|
||||
|
||||

|
||||
|
||||
Pluralize words in different locales
|
||||
|
||||
## Install
|
||||
|
||||
``` bash
|
||||
cargo add plurify
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
``` rust
|
||||
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), "котів");
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue