11 releases (6 stable)

✓ Uses Rust 2018 edition

3.0.0 Sep 10, 2019
2.0.0 Jul 26, 2019
1.1.0 Jul 25, 2019
1.0.3 Mar 29, 2019
0.8.2 Jul 31, 2018

#10 in Internationalization (i18n)

Download history 807/week @ 2019-05-28 670/week @ 2019-06-04 977/week @ 2019-06-11 780/week @ 2019-06-18 1135/week @ 2019-06-25 886/week @ 2019-07-02 633/week @ 2019-07-09 734/week @ 2019-07-16 696/week @ 2019-07-23 650/week @ 2019-07-30 716/week @ 2019-08-06 604/week @ 2019-08-13 687/week @ 2019-08-20 580/week @ 2019-08-27 750/week @ 2019-09-03

3,172 downloads per month
Used in 14 crates (2 directly)

Apache-2.0/MIT

165KB
3.5K SLoC

INTL Plural Rules

intl_pluralrules categorizes numbers by plural operands. See Unicode Plural Rules

crates.io Build Status Coverage Status

This library is intended to be used to find the plural category of numeric input.

Status

Currently produces operands compliant with CLDR 35 into Rust 1.31 and above.

Updating CLDR Data

If you would like to update rules.rs with plural rules that are not the specified version above (e.g. future versions of CLDR or external CLDR-compliant rules), you can regenerate the logic in rules.rs with the command:

cargo regenerate-data

You will need to replace the JSON files under /cldr_data/ with your new CLDR JSON files.

Local Development

cargo build
cargo test

When submitting a PR please use cargo fmt.

Contributors

Thank you to all contributors!

Dependencies

~110KB