zbraniecki / pluralrules

Pluralization handling in Rust
36 stars 4 forks source link

Support multiple inputs to generate cardinals and ordinals #6

Closed zbraniecki closed 6 years ago

zbraniecki commented 6 years ago

This patch adds support for ordinals alongside cardinals.

The approach I picked is to switch the signature of the client side app to take two arguments -i and -o, where -i can be one or more paths. This allows for passing just one json, or multiple (cardinals and ordinals).

Then, I modified logic in the codegen crate to generate a nested match in get_pr that takes PluralRuleType and locale, and changed the LOCALES array to be a new function get_locales that also takes PluralRuleType.

This change should make it easier to implement the IntlPluralRule structure that will accept locale/pluralruletype in constructor and number in select.

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 28


Changes Missing Coverage Covered Lines Changed/Added Lines %
make_pluralrules/src/parser/gen_rs.rs 26 28 92.86%
make_pluralrules/src/lib.rs 45 49 91.84%
make_pluralrules/src/main.rs 0 10 0.0%
<!-- Total: 76 92 82.61% -->
Files with Coverage Reduction New Missed Lines %
make_pluralrules/src/main.rs 1 0.0%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 27: 1.4%
Covered Lines: 496
Relevant Lines: 1457

💛 - Coveralls