From a8ead3bc47560fc7eba4e6c3b4ab610649d2d078 Mon Sep 17 00:00:00 2001 From: Zibi Braniecki Date: Wed, 6 May 2020 03:05:01 -0700 Subject: [PATCH] CLDR 37 --- .../cldr_data/cldr_pluralrules_cardinals.json | 13 ++++++++-- .../cldr_data/cldr_pluralrules_ordinals.json | 4 ++-- intl_pluralrules/src/lib.rs | 2 +- intl_pluralrules/src/rules.rs | 24 ++++++++++++++++++- 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/intl_pluralrules/cldr_data/cldr_pluralrules_cardinals.json b/intl_pluralrules/cldr_data/cldr_pluralrules_cardinals.json index 72c759a..bcb2412 100644 --- a/intl_pluralrules/cldr_data/cldr_pluralrules_cardinals.json +++ b/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": { @@ -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, …", @@ -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, …" diff --git a/intl_pluralrules/cldr_data/cldr_pluralrules_ordinals.json b/intl_pluralrules/cldr_data/cldr_pluralrules_ordinals.json index 223ddfb..7ef193a 100644 --- a/intl_pluralrules/cldr_data/cldr_pluralrules_ordinals.json +++ b/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": { diff --git a/intl_pluralrules/src/lib.rs b/intl_pluralrules/src/lib.rs index 50274f5..389aacf 100644 --- a/intl_pluralrules/src/lib.rs +++ b/intl_pluralrules/src/lib.rs @@ -212,7 +212,7 @@ mod tests { #[test] fn version_test() { - assert_eq!(CLDR_VERSION, 36); + assert_eq!(CLDR_VERSION, 37); } #[test] diff --git a/intl_pluralrules/src/rules.rs b/intl_pluralrules/src/rules.rs index 91d37c7..3e3db39 100644 --- a/intl_pluralrules/src/rules.rs +++ b/intl_pluralrules/src/rules.rs @@ -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) } @@ -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| { @@ -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| {