Skip to content

Commit

Permalink
CLDR 37
Browse files Browse the repository at this point in the history
  • Loading branch information
zbraniecki committed May 6, 2020
1 parent 247fb0d commit a8ead3b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
13 changes: 11 additions & 2 deletions intl_pluralrules/cldr_data/cldr_pluralrules_cardinals.json
@@ -1,8 +1,8 @@
{
"supplemental": {
"version": {
"_unicodeVersion": "12.1.0",
"_cldrVersion": "36"
"_unicodeVersion": "13.0.0",
"_cldrVersion": "37"
},
"plurals-type-cardinal": {
"af": {
Expand Down Expand Up @@ -587,6 +587,10 @@
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"pcm": {
"pluralRule-count-one": "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04",
"pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~2.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"pl": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-few": "v = 0 and i % 10 = 2..4 and i % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, …",
Expand Down Expand Up @@ -643,6 +647,11 @@
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sat": {
"pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000",
"pluralRule-count-two": "n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000",
"pluralRule-count-other": " @integer 0, 3~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
},
"sc": {
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
Expand Down
4 changes: 2 additions & 2 deletions intl_pluralrules/cldr_data/cldr_pluralrules_ordinals.json
@@ -1,8 +1,8 @@
{
"supplemental": {
"version": {
"_unicodeVersion": "12.1.0",
"_cldrVersion": "36"
"_unicodeVersion": "13.0.0",
"_cldrVersion": "37"
},
"plurals-type-ordinal": {
"af": {
Expand Down
2 changes: 1 addition & 1 deletion intl_pluralrules/src/lib.rs
Expand Up @@ -212,7 +212,7 @@ mod tests {

#[test]
fn version_test() {
assert_eq!(CLDR_VERSION, 36);
assert_eq!(CLDR_VERSION, 37);
}

#[test]
Expand Down
24 changes: 23 additions & 1 deletion intl_pluralrules/src/rules.rs
Expand Up @@ -7,7 +7,7 @@ use super::PluralCategory;
use tinystr::{TinyStr4, TinyStr8};
use unic_langid::LanguageIdentifier;
pub type PluralRule = fn(&PluralOperands) -> PluralCategory;
pub static CLDR_VERSION: usize = 36;
pub static CLDR_VERSION: usize = 37;
macro_rules! langid {
( $ lang : expr , $ script : expr , $ region : expr ) => {{
unsafe { LanguageIdentifier::from_raw_parts_unchecked($lang, $script, $region, None) }
Expand Down Expand Up @@ -1428,6 +1428,16 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[
}
},
),
(
langid!(Some(TinyStr8::new_unchecked(7168880u64)), None, None),
|po| {
if (po.i == 0) || (po.n == 1.0) {
PluralCategory::ONE
} else {
PluralCategory::OTHER
}
},
),
(
langid!(Some(TinyStr8::new_unchecked(27760u64)), None, None),
|po| {
Expand Down Expand Up @@ -1570,6 +1580,18 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[
}
},
),
(
langid!(Some(TinyStr8::new_unchecked(7627123u64)), None, None),
|po| {
if (po.n == 1.0) {
PluralCategory::ONE
} else if (po.n == 2.0) {
PluralCategory::TWO
} else {
PluralCategory::OTHER
}
},
),
(
langid!(Some(TinyStr8::new_unchecked(25459u64)), None, None),
|po| {
Expand Down

0 comments on commit a8ead3b

Please sign in to comment.