Closed zbraniecki closed 6 years ago
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 | |
---|---|
Change from base Build 27: | 1.4% |
Covered Lines: | 496 |
Relevant Lines: | 1457 |
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
inget_pr
that takesPluralRuleType
andlocale
, and changed theLOCALES
array to be a new functionget_locales
that also takesPluralRuleType
.This change should make it easier to implement the
IntlPluralRule
structure that will accept locale/pluralruletype in constructor and number in select.