From 84922363f4014eae684aabc4f1d06380066494c5 Mon Sep 17 00:00:00 2001 From: Bogdan Tara Date: Tue, 1 Sep 2020 09:40:56 +0300 Subject: [PATCH] Backed out changeset ad6c81e11152 (bug 1662309) for CheckCapacity assertion failures CLOSED TREE --- Cargo.lock | 28 +- intl/l10n/rust/fluent-ffi/Cargo.toml | 6 +- intl/l10n/rust/fluent-ffi/src/builtins.rs | 2 +- .../locale/rust/fluent-langneg-ffi/Cargo.toml | 4 +- intl/locale/rust/unic-langid-ffi/Cargo.toml | 2 +- intl/locale/rust/unic-langid-ffi/src/lib.rs | 51 +- .../rust/fluent-bundle/.cargo-checksum.json | 2 +- third_party/rust/fluent-bundle/CHANGELOG.md | 145 +++ third_party/rust/fluent-bundle/Cargo.lock | 855 +++++++++++++ third_party/rust/fluent-bundle/Cargo.toml | 13 +- .../rust/fluent-bundle/benches/menubar.ftl | 318 +++++ .../fluent-bundle/benches/preferences.ftl | 1077 +++++++++++++++++ .../rust/fluent-bundle/benches/simple.ftl | 102 ++ .../rust/fluent-bundle/benches/unescape.ftl | 9 + .../examples/custom_formatter.rs | 145 +++ .../fluent-bundle/examples/custom_type.rs | 190 +++ .../examples/external_arguments.rs | 50 + .../rust/fluent-bundle/examples/functions.rs | 82 ++ .../rust/fluent-bundle/examples/hello.rs | 18 + .../examples/message_reference.rs | 33 + .../examples/resources/en-US/simple.ftl | 7 + .../examples/resources/fr/simple.ftl | 7 + .../examples/resources/pl/simple.ftl | 8 + .../rust/fluent-bundle/examples/selector.rs | 41 + .../rust/fluent-bundle/examples/simple-app.rs | 179 +++ .../rust/fluent-bundle/src/types/mod.rs | 8 +- .../rust/fluent-bundle/src/types/number.rs | 2 +- .../rust/fluent-bundle/tests/bundle.rs | 37 + .../rust/fluent-bundle/tests/custom_types.rs | 230 ++++ .../tests/fixtures/arguments.yaml | 133 ++ .../tests/fixtures/attributes.yaml | 178 +++ .../fluent-bundle/tests/fixtures/bomb.yaml | 30 + .../fluent-bundle/tests/fixtures/context.yaml | 195 +++ .../tests/fixtures/defaults.yaml | 6 + .../fluent-bundle/tests/fixtures/errors.yaml | 21 + .../tests/fixtures/functions.yaml | 85 ++ .../tests/fixtures/functions_runtime.yaml | 29 + .../tests/fixtures/isolating.yaml | 100 ++ .../tests/fixtures/literals.yaml | 69 ++ .../fluent-bundle/tests/fixtures/macros.yaml | 392 ++++++ .../tests/fixtures/patterns.yaml | 218 ++++ .../tests/fixtures/primitives.yaml | 154 +++ .../tests/fixtures/select_expression.yaml | 151 +++ .../tests/fixtures/transform.yaml | 48 + .../tests/fixtures/values_format.yaml | 74 ++ .../tests/fixtures/values_ref.yaml | 140 +++ .../rust/fluent-bundle/tests/helpers/mod.rs | 202 ++++ .../fluent-bundle/tests/resolver_fixtures.rs | 363 ++++++ .../rust/fluent-bundle/tests/types_test.rs | 156 +++ .../rust/fluent-langneg/.cargo-checksum.json | 2 +- third_party/rust/fluent-langneg/CHANGELOG.md | 72 ++ third_party/rust/fluent-langneg/Cargo.lock | 629 ++++++++++ third_party/rust/fluent-langneg/Cargo.toml | 9 +- third_party/rust/fluent-langneg/LICENSE | 201 +++ .../rust/fluent-langneg/examples/negotiate.rs | 11 + .../src/negotiate/likely_subtags.rs | 18 +- .../rust/fluent-langneg/src/negotiate/mod.rs | 6 +- .../tests/fixtures/accepted_languages.json | 26 + .../tests/fixtures/locale/options-ext.json | 34 + .../tests/fixtures/locale/options.json | 53 + .../tests/fixtures/locale/parsing-ext.json | 44 + .../tests/fixtures/locale/parsing.json | 151 +++ .../fixtures/locale/serialize-options.json | 21 + .../filtering/available-as-range.json | 26 + .../fixtures/negotiate/filtering/cases.json | 34 + .../negotiate/filtering/cross-region.json | 14 + .../negotiate/filtering/cross-variant.json | 6 + .../negotiate/filtering/default-locale.json | 18 + .../fixtures/negotiate/filtering/errors.json | 34 + .../negotiate/filtering/exact-match.json | 26 + .../negotiate/filtering/likely-subtag.json | 42 + .../negotiate/filtering/prioritize.json | 30 + .../negotiate/filtering/requested-und.json | 10 + .../tests/fixtures/negotiate/lookup/main.json | 22 + .../fixtures/negotiate/matching/main.json | 12 + third_party/rust/fluent-langneg/tests/lib.rs | 214 ++++ third_party/rust/fluent/.cargo-checksum.json | 2 +- third_party/rust/fluent/CHANGELOG.md | 51 + third_party/rust/fluent/Cargo.toml | 7 +- third_party/rust/fluent/tests/macro.rs | 21 + third_party/rust/fluent/tests/pseudo.rs | 34 + .../rust/intl-memoizer/.cargo-checksum.json | 2 +- third_party/rust/intl-memoizer/CHANGELOG.md | 14 + third_party/rust/intl-memoizer/Cargo.lock | 78 ++ third_party/rust/intl-memoizer/Cargo.toml | 9 +- .../intl-memoizer/examples/numberformat.rs | 78 ++ .../intl-memoizer/examples/pluralrules.rs | 31 + .../intl_pluralrules/.cargo-checksum.json | 2 +- .../rust/intl_pluralrules/CHANGELOG.md | 87 ++ third_party/rust/intl_pluralrules/Cargo.toml | 7 +- .../cldr_data/cldr_pluralrules_cardinals.json | 893 ++++++++++++++ .../cldr_data/cldr_pluralrules_ordinals.json | 373 ++++++ third_party/rust/intl_pluralrules/src/lib.rs | 2 +- .../rust/intl_pluralrules/src/operands.rs | 18 +- .../rust/intl_pluralrules/src/rules.rs | 1010 ++++++---------- .../rust/intl_pluralrules/tests/operands.rs | 133 ++ .../unic-langid-impl/.cargo-checksum.json | 2 +- third_party/rust/unic-langid-impl/Cargo.lock | 530 ++++---- third_party/rust/unic-langid-impl/Cargo.toml | 4 +- .../unic-langid-impl/benches/canonicalize.rs | 14 - .../rust/unic-langid-impl/benches/langid.rs | 68 +- .../data/cldr-misc-full/README.md | 6 - .../src/bin/generate_layout.rs | 84 +- .../src/bin/generate_likelysubtags.rs | 64 +- .../rust/unic-langid-impl/src/layout_table.rs | 5 +- third_party/rust/unic-langid-impl/src/lib.rs | 425 +++++-- .../unic-langid-impl/src/likelysubtags/mod.rs | 52 +- .../rust/unic-langid-impl/src/parser/mod.rs | 30 +- .../rust/unic-langid-impl/src/serde.rs | 60 - .../rust/unic-langid-impl/src/subtags.rs | 71 ++ .../unic-langid-impl/src/subtags/language.rs | 108 -- .../rust/unic-langid-impl/src/subtags/mod.rs | 9 - .../unic-langid-impl/src/subtags/region.rs | 74 -- .../unic-langid-impl/src/subtags/script.rs | 62 - .../unic-langid-impl/src/subtags/variant.rs | 78 -- .../tests/canonicalize_test.rs | 13 + .../rust/unic-langid-impl/tests/fixtures.rs | 75 ++ .../tests/fixtures/parsing.json | 160 +++ .../tests/language_identifier_test.rs | 193 +++ .../unic-langid-impl/tests/likelysubtags.rs | 105 ++ .../rust/unic-langid/.cargo-checksum.json | 2 +- third_party/rust/unic-langid/CHANGELOG.md | 60 + third_party/rust/unic-langid/Cargo.lock | 96 ++ third_party/rust/unic-langid/Cargo.toml | 10 +- .../unic-langid/examples/simple-langid.rs | 20 + third_party/rust/unic-langid/src/lib.rs | 43 +- third_party/rust/unic-langid/tests/langid.rs | 52 + toolkit/library/rust/shared/Cargo.toml | 6 +- 128 files changed, 11861 insertions(+), 1732 deletions(-) create mode 100644 third_party/rust/fluent-bundle/CHANGELOG.md create mode 100644 third_party/rust/fluent-bundle/Cargo.lock create mode 100644 third_party/rust/fluent-bundle/benches/menubar.ftl create mode 100644 third_party/rust/fluent-bundle/benches/preferences.ftl create mode 100644 third_party/rust/fluent-bundle/benches/simple.ftl create mode 100644 third_party/rust/fluent-bundle/benches/unescape.ftl create mode 100644 third_party/rust/fluent-bundle/examples/custom_formatter.rs create mode 100644 third_party/rust/fluent-bundle/examples/custom_type.rs create mode 100644 third_party/rust/fluent-bundle/examples/external_arguments.rs create mode 100644 third_party/rust/fluent-bundle/examples/functions.rs create mode 100644 third_party/rust/fluent-bundle/examples/hello.rs create mode 100644 third_party/rust/fluent-bundle/examples/message_reference.rs create mode 100644 third_party/rust/fluent-bundle/examples/resources/en-US/simple.ftl create mode 100644 third_party/rust/fluent-bundle/examples/resources/fr/simple.ftl create mode 100644 third_party/rust/fluent-bundle/examples/resources/pl/simple.ftl create mode 100644 third_party/rust/fluent-bundle/examples/selector.rs create mode 100644 third_party/rust/fluent-bundle/examples/simple-app.rs create mode 100644 third_party/rust/fluent-bundle/tests/bundle.rs create mode 100644 third_party/rust/fluent-bundle/tests/custom_types.rs create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/arguments.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/attributes.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/bomb.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/context.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/defaults.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/errors.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/functions.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/functions_runtime.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/isolating.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/literals.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/macros.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/patterns.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/primitives.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/select_expression.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/transform.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/values_format.yaml create mode 100644 third_party/rust/fluent-bundle/tests/fixtures/values_ref.yaml create mode 100644 third_party/rust/fluent-bundle/tests/helpers/mod.rs create mode 100644 third_party/rust/fluent-bundle/tests/resolver_fixtures.rs create mode 100644 third_party/rust/fluent-bundle/tests/types_test.rs create mode 100644 third_party/rust/fluent-langneg/CHANGELOG.md create mode 100644 third_party/rust/fluent-langneg/Cargo.lock create mode 100644 third_party/rust/fluent-langneg/LICENSE create mode 100644 third_party/rust/fluent-langneg/examples/negotiate.rs create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/accepted_languages.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/locale/options-ext.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/locale/options.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/locale/parsing-ext.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/locale/parsing.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/locale/serialize-options.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/negotiate/filtering/available-as-range.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/negotiate/filtering/cases.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/negotiate/filtering/cross-region.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/negotiate/filtering/cross-variant.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/negotiate/filtering/default-locale.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/negotiate/filtering/errors.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/negotiate/filtering/exact-match.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/negotiate/filtering/likely-subtag.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/negotiate/filtering/prioritize.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/negotiate/filtering/requested-und.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/negotiate/lookup/main.json create mode 100644 third_party/rust/fluent-langneg/tests/fixtures/negotiate/matching/main.json create mode 100644 third_party/rust/fluent-langneg/tests/lib.rs create mode 100644 third_party/rust/fluent/CHANGELOG.md create mode 100644 third_party/rust/fluent/tests/macro.rs create mode 100644 third_party/rust/fluent/tests/pseudo.rs create mode 100644 third_party/rust/intl-memoizer/CHANGELOG.md create mode 100644 third_party/rust/intl-memoizer/Cargo.lock create mode 100644 third_party/rust/intl-memoizer/examples/numberformat.rs create mode 100644 third_party/rust/intl-memoizer/examples/pluralrules.rs create mode 100644 third_party/rust/intl_pluralrules/CHANGELOG.md create mode 100644 third_party/rust/intl_pluralrules/cldr_data/cldr_pluralrules_cardinals.json create mode 100644 third_party/rust/intl_pluralrules/cldr_data/cldr_pluralrules_ordinals.json create mode 100644 third_party/rust/intl_pluralrules/tests/operands.rs delete mode 100644 third_party/rust/unic-langid-impl/data/cldr-misc-full/README.md delete mode 100644 third_party/rust/unic-langid-impl/src/serde.rs create mode 100644 third_party/rust/unic-langid-impl/src/subtags.rs delete mode 100644 third_party/rust/unic-langid-impl/src/subtags/language.rs delete mode 100644 third_party/rust/unic-langid-impl/src/subtags/mod.rs delete mode 100644 third_party/rust/unic-langid-impl/src/subtags/region.rs delete mode 100644 third_party/rust/unic-langid-impl/src/subtags/script.rs delete mode 100644 third_party/rust/unic-langid-impl/src/subtags/variant.rs create mode 100644 third_party/rust/unic-langid-impl/tests/canonicalize_test.rs create mode 100644 third_party/rust/unic-langid-impl/tests/fixtures.rs create mode 100644 third_party/rust/unic-langid-impl/tests/fixtures/parsing.json create mode 100644 third_party/rust/unic-langid-impl/tests/language_identifier_test.rs create mode 100644 third_party/rust/unic-langid-impl/tests/likelysubtags.rs create mode 100644 third_party/rust/unic-langid/CHANGELOG.md create mode 100644 third_party/rust/unic-langid/Cargo.lock create mode 100644 third_party/rust/unic-langid/examples/simple-langid.rs create mode 100644 third_party/rust/unic-langid/tests/langid.rs diff --git a/Cargo.lock b/Cargo.lock index 94e3afbc7636..3894bc96d175 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1448,9 +1448,9 @@ dependencies = [ [[package]] name = "fluent" -version = "0.12.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3b6132d1377d8776409a337c6851d342aee4e85277c96ecd2755c4e0efde1d" +checksum = "9ebe7532e1e5146a909de9e019e31835a84b5dee3eeb234561e525844f3cf3bf" dependencies = [ "fluent-bundle", "fluent-pseudo", @@ -1459,9 +1459,9 @@ dependencies = [ [[package]] name = "fluent-bundle" -version = "0.12.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a094d494ab2ed06077e9a95f4e47f446c376de95f6c93045dd88c499bfcd70" +checksum = "27ade33328521266c81cc0924523988f43ccd7359f64689a1b6e818afca3a646" dependencies = [ "fluent-langneg", "fluent-syntax", @@ -1486,9 +1486,9 @@ dependencies = [ [[package]] name = "fluent-langneg" -version = "0.13.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4ad0989667548f06ccd0e306ed56b61bd4d35458d54df5ec7587c0e8ed5e94" +checksum = "fe5815efd5542e40841cd34ef9003822352b04c67a70c595c6758597c72e1f56" dependencies = [ "unic-langid", ] @@ -2371,9 +2371,9 @@ source = "git+https://github.com/mozilla/application-services?rev=9ba519a5739b19 [[package]] name = "intl-memoizer" -version = "0.5.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0ed58ba6089d49f8a9a7d5e16fc9b9e2019cdf40ef270f3d465fa244d9630b" +checksum = "9867e2d65d82936ef34217ed0f87b639a94384e93a0676158142c861c705391f" dependencies = [ "type-map", "unic-langid", @@ -2381,9 +2381,9 @@ dependencies = [ [[package]] name = "intl_pluralrules" -version = "7.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c271cdb1f12a9feb3a017619c3ee681f971f270f6757341d6abe1f9f7a98bc3" +checksum = "d82c14d8eece42c03353e0ce86a4d3f97b1f1cef401e4d962dca6c6214a85002" dependencies = [ "tinystr", "unic-langid", @@ -5290,9 +5290,9 @@ dependencies = [ [[package]] name = "unic-langid" -version = "0.9.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73328fcd730a030bdb19ddf23e192187a6b01cd98be6d3140622a89129459ce5" +checksum = "24d81136159f779c35b10655f45210c71cd5ca5a45aadfe9840a61c7071735ed" dependencies = [ "unic-langid-impl", ] @@ -5310,9 +5310,9 @@ dependencies = [ [[package]] name = "unic-langid-impl" -version = "0.9.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a4a8eeaf0494862c1404c95ec2f4c33a2acff5076f64314b465e3ddae1b934d" +checksum = "c43c61e94492eb67f20facc7b025778a904de83d953d8fcb60dd9adfd6e2d0ea" dependencies = [ "tinystr", ] diff --git a/intl/l10n/rust/fluent-ffi/Cargo.toml b/intl/l10n/rust/fluent-ffi/Cargo.toml index bcd26f30ab13..b949e5e9ca00 100644 --- a/intl/l10n/rust/fluent-ffi/Cargo.toml +++ b/intl/l10n/rust/fluent-ffi/Cargo.toml @@ -5,9 +5,9 @@ authors = ["Zibi Braniecki "] edition = "2018" [dependencies] -fluent = { version = "0.12" , features = ["fluent-pseudo"] } +fluent = { version = "0.11" , features = ["fluent-pseudo"] } fluent-pseudo = "0.2" -intl-memoizer = "0.5" -unic-langid = "0.9" +intl-memoizer = "0.4" +unic-langid = "0.8" nsstring = { path = "../../../../xpcom/rust/nsstring" } thin-vec = { version = "0.1.0", features = ["gecko-ffi"] } diff --git a/intl/l10n/rust/fluent-ffi/src/builtins.rs b/intl/l10n/rust/fluent-ffi/src/builtins.rs index 2abc817f31a7..d0ebe4a3a74a 100644 --- a/intl/l10n/rust/fluent-ffi/src/builtins.rs +++ b/intl/l10n/rust/fluent-ffi/src/builtins.rs @@ -380,7 +380,7 @@ pub struct FluentDateTime { } impl FluentType for FluentDateTime { - fn duplicate(&self) -> Box { + fn duplicate(&self) -> Box { Box::new(self.clone()) } fn as_string(&self, intls: &IntlLangMemoizer) -> Cow<'static, str> { diff --git a/intl/locale/rust/fluent-langneg-ffi/Cargo.toml b/intl/locale/rust/fluent-langneg-ffi/Cargo.toml index e1b3f607ee85..2b00f28f4501 100644 --- a/intl/locale/rust/fluent-langneg-ffi/Cargo.toml +++ b/intl/locale/rust/fluent-langneg-ffi/Cargo.toml @@ -10,6 +10,6 @@ nserror = { path = "../../../../xpcom/rust/nserror" } nsstring = { path = "../../../../xpcom/rust/nsstring" } xpcom = { path = "../../../../xpcom/rust/xpcom" } thin-vec = { version = "0.1.0", features = ["gecko-ffi"] } -fluent-langneg = { version = "0.13", features = ["cldr"] } -unic-langid = "0.9" +fluent-langneg = { version = "0.12.1", features = ["cldr"] } +unic-langid = "0.8" unic-langid-ffi = { path = "../unic-langid-ffi" } diff --git a/intl/locale/rust/unic-langid-ffi/Cargo.toml b/intl/locale/rust/unic-langid-ffi/Cargo.toml index 62b78b12ceac..d141f20c2509 100644 --- a/intl/locale/rust/unic-langid-ffi/Cargo.toml +++ b/intl/locale/rust/unic-langid-ffi/Cargo.toml @@ -10,4 +10,4 @@ nserror = { path = "../../../../xpcom/rust/nserror" } nsstring = { path = "../../../../xpcom/rust/nsstring" } xpcom = { path = "../../../../xpcom/rust/xpcom" } thin-vec = { version = "0.1.0", features = ["gecko-ffi"] } -unic-langid = { version = "0.9", features = ["likelysubtags"] } +unic-langid = { version = "0.8", features = ["likelysubtags"] } diff --git a/intl/locale/rust/unic-langid-ffi/src/lib.rs b/intl/locale/rust/unic-langid-ffi/src/lib.rs index 9174df12ca66..e42b1413e135 100644 --- a/intl/locale/rust/unic-langid-ffi/src/lib.rs +++ b/intl/locale/rust/unic-langid-ffi/src/lib.rs @@ -5,7 +5,7 @@ use nsstring::nsACString; use nsstring::nsCString; use thin_vec::ThinVec; -pub use unic_langid::{subtags, CharacterDirection, LanguageIdentifier, LanguageIdentifierError}; +pub use unic_langid::{CharacterDirection, LanguageIdentifier, LanguageIdentifierError}; pub fn new_langid_for_mozilla( name: &nsACString, @@ -62,7 +62,7 @@ pub unsafe extern "C" fn unic_langid_get_language( langid: &LanguageIdentifier, len: *mut u32, ) -> *const u8 { - let lang = langid.language.as_str(); + let lang = langid.language(); *len = lang.len() as u32; lang.as_bytes().as_ptr() } @@ -72,14 +72,12 @@ pub unsafe extern "C" fn unic_langid_set_language( langid: &mut LanguageIdentifier, string: &nsACString, ) -> bool { - subtags::Language::from_bytes(string) - .map(|lang| langid.language = lang) - .is_ok() + langid.set_language(string).is_ok() } #[no_mangle] pub unsafe extern "C" fn unic_langid_clear_language(langid: &mut LanguageIdentifier) { - langid.language.clear() + langid.clear_language() } #[no_mangle] @@ -87,13 +85,9 @@ pub unsafe extern "C" fn unic_langid_get_script( langid: &LanguageIdentifier, len: *mut u32, ) -> *const u8 { - if let Some(script) = langid.script { - let script = script.as_str(); - *len = script.len() as u32; - script.as_bytes().as_ptr() - } else { - std::ptr::null() - } + let script = langid.script().unwrap_or(""); + *len = script.len() as u32; + script.as_bytes().as_ptr() } #[no_mangle] @@ -101,14 +95,12 @@ pub unsafe extern "C" fn unic_langid_set_script( langid: &mut LanguageIdentifier, string: &nsACString, ) -> bool { - subtags::Script::from_bytes(string) - .map(|script| langid.script = Some(script)) - .is_ok() + langid.set_script(string).is_ok() } #[no_mangle] pub unsafe extern "C" fn unic_langid_clear_script(langid: &mut LanguageIdentifier) { - langid.script = None; + langid.clear_script() } #[no_mangle] @@ -116,13 +108,9 @@ pub unsafe extern "C" fn unic_langid_get_region( langid: &LanguageIdentifier, len: *mut u32, ) -> *const u8 { - if let Some(region) = langid.region { - let region = region.as_str(); - *len = region.len() as u32; - region.as_bytes().as_ptr() - } else { - std::ptr::null() - } + let region = langid.region().unwrap_or(""); + *len = region.len() as u32; + region.as_bytes().as_ptr() } #[no_mangle] @@ -130,14 +118,12 @@ pub unsafe extern "C" fn unic_langid_set_region( langid: &mut LanguageIdentifier, string: &nsACString, ) -> bool { - subtags::Region::from_bytes(string) - .map(|region| langid.region = Some(region)) - .is_ok() + langid.set_region(string).is_ok() } #[no_mangle] pub unsafe extern "C" fn unic_langid_clear_region(langid: &mut LanguageIdentifier) { - langid.region = None; + langid.clear_region() } #[no_mangle] @@ -146,7 +132,7 @@ pub unsafe extern "C" fn unic_langid_get_variants( variants: &mut ThinVec, ) { for v in langid.variants() { - variants.push(v.as_str().into()); + variants.push(v.into()); } } @@ -155,12 +141,7 @@ pub unsafe extern "C" fn unic_langid_set_variants( langid: &mut LanguageIdentifier, variants: &ThinVec, ) -> bool { - variants - .iter() - .map(|v| subtags::Variant::from_bytes(v)) - .collect::, _>>() - .map(|variants| langid.set_variants(&variants)) - .is_ok() + langid.set_variants(variants).is_ok() } #[no_mangle] diff --git a/third_party/rust/fluent-bundle/.cargo-checksum.json b/third_party/rust/fluent-bundle/.cargo-checksum.json index 802121391676..ddcd0b95e7d8 100644 --- a/third_party/rust/fluent-bundle/.cargo-checksum.json +++ b/third_party/rust/fluent-bundle/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"4e9077bbdaa6404025c55195f13068514e2ba2fe8441ce2f9a836fa3a3705527","README.md":"80b1ac2d22e813da57353131a86e05735201197c4938f8e8bbc0b29b00b1ed24","benches/resolver.rs":"bf0cdc5a39da2c7f0a9d63387f4ed1f82a260a69054a01505d3b6d933843cbca","examples/README.md":"99a51f7d388d2da3c5291e68de5264feaf642ba9a22f6f882c3b940c1b6429b2","src/bundle.rs":"5d2e6cdf2eda5379608332d547e32246fd39953a71d9d8f8482ae096e04b23c9","src/concurrent.rs":"71b737bb764a07d7b2aac52f2ecda5545238b259a716d5ee60098580ab1ed65a","src/entry.rs":"c1f06bcb170c9ebfe575ad7e300a52fd9b723fa0538c9e6912485d612a29342b","src/errors.rs":"86aa6359878320230e91b7b9c91d26c6cb31464991396077ade7dd2b3e09e08b","src/lib.rs":"713d0a291d71ccd046971185f9ee06e34d47215911a62eada8b668746204491e","src/memoizer.rs":"922084f71f02d0532056db9b41cec4c1434001fe60215ee6f6ac8e3fd2518f12","src/resolve.rs":"8ea65ddf10e12a6685c2dba59e46251b4145ab126504266be9548bf312cd8917","src/resource.rs":"fb98d01b2aeb370f2f411fed85485dc1dc23e1acd50116db55c0449e3e79340f","src/types/mod.rs":"75c744261d399fc729de3dd2d45336959efd270a069138fed9e908ade8a1b760","src/types/number.rs":"ee1c02f8f7093652416b953cb77b81a30a87bd9b210f5222ac090d382da68cb0","src/types/plural.rs":"f28834e71d6970d5eb48089132f5242433b1e62b90765d85e3c76f805eecc92e"},"package":"01a094d494ab2ed06077e9a95f4e47f446c376de95f6c93045dd88c499bfcd70"} \ No newline at end of file +{"files":{"CHANGELOG.md":"239a5f359dd51b9a093b3648bbd418b73cd454d34827cbc8f8f7d6d1ca43d25c","Cargo.lock":"3a468c3e598d210c97969d128cbb79017c2b7d181e542e66071ac84754be8730","Cargo.toml":"61ac35fe8898e441ccb8887f3c08d4f6cff9aa22b450d8ea804b29c7c5898081","README.md":"80b1ac2d22e813da57353131a86e05735201197c4938f8e8bbc0b29b00b1ed24","benches/menubar.ftl":"dead3b3163f4e2e90c71d85c3b7d26f77422940173fbfb6b879ac21888f2a6c4","benches/preferences.ftl":"759f8d4ba22793c9e739fef1591ce2e433041d47f0f1d7566e5c13888c997183","benches/resolver.rs":"bf0cdc5a39da2c7f0a9d63387f4ed1f82a260a69054a01505d3b6d933843cbca","benches/simple.ftl":"38ffdf3bceb33eb3c9790c373b039810e79acd149bd21396be8bccb7f6e74024","benches/unescape.ftl":"823e09fc412feb0ad821e67f2a4c92f0a15eca845fb3f8af4e9033ddfe2f87f8","examples/README.md":"99a51f7d388d2da3c5291e68de5264feaf642ba9a22f6f882c3b940c1b6429b2","examples/custom_formatter.rs":"eae5635da023f3760c5d8a4f05d98addd89618affe396f20024ed36b1f21c265","examples/custom_type.rs":"c97ecea1e4698b1f708fa3a56438ce82b82b52b6b937d93a5735103047e6c443","examples/external_arguments.rs":"83c73e3e0b5f640da2f8044d368c23316287be486c682a67f99be5256adb896d","examples/functions.rs":"6a0f34fea1570e59e6a0941a855d614b51d22d802344f7ad5f0654de47d2631f","examples/hello.rs":"b8e867bb270793c5a20606241d050c4c174bc413d393a7f1750dbab8aa68ba7b","examples/message_reference.rs":"3176e79d3300b5fc9a4a8a6e5bc581b61b3917dfd7bc7a723ba6e4ccd1ac3c57","examples/resources/en-US/simple.ftl":"55e8a72973d239c6ed3eb3d9cbc21d37dc90cea9fad85d1d8d73c96d63941629","examples/resources/fr/simple.ftl":"c0b376a718b051dc6d0b531c35d90b964094522d467fb14cb5325cf3a4ff88ce","examples/resources/pl/simple.ftl":"d63d7c62c225897d9f28f166c17e038b8f780dca9e9ee640e81360f23219a212","examples/selector.rs":"e6fff553db51af123a336da7a2aaa3996e7c275744d2f17ded4a3ec163bad543","examples/simple-app.rs":"7fb7f5d1cee07f4c9571999530b8b38cf03ab5b8d02c9eac86fc573575acb71b","src/bundle.rs":"5d2e6cdf2eda5379608332d547e32246fd39953a71d9d8f8482ae096e04b23c9","src/concurrent.rs":"71b737bb764a07d7b2aac52f2ecda5545238b259a716d5ee60098580ab1ed65a","src/entry.rs":"c1f06bcb170c9ebfe575ad7e300a52fd9b723fa0538c9e6912485d612a29342b","src/errors.rs":"86aa6359878320230e91b7b9c91d26c6cb31464991396077ade7dd2b3e09e08b","src/lib.rs":"713d0a291d71ccd046971185f9ee06e34d47215911a62eada8b668746204491e","src/memoizer.rs":"922084f71f02d0532056db9b41cec4c1434001fe60215ee6f6ac8e3fd2518f12","src/resolve.rs":"8ea65ddf10e12a6685c2dba59e46251b4145ab126504266be9548bf312cd8917","src/resource.rs":"fb98d01b2aeb370f2f411fed85485dc1dc23e1acd50116db55c0449e3e79340f","src/types/mod.rs":"bbd570b9696be5b7d6d1c7b2bed05d95c9ce7698c0704f123dfbd4b950c5a3ef","src/types/number.rs":"a96de1af2715af59f2cec987d3644d7e177b40622c93219bf92a92ba8a562787","src/types/plural.rs":"f28834e71d6970d5eb48089132f5242433b1e62b90765d85e3c76f805eecc92e","tests/bundle.rs":"c85706a13fb36272702ba98655640cc630585c670b9dd6a55403a42b2fc7fdb4","tests/custom_types.rs":"430258f76f9404b9c9987958361e3656caed52731755d22a9d66d10cb5eecb3d","tests/fixtures/arguments.yaml":"6be2e84b5b80f3b22e5bb708695e1d43d1803471d65ea9ab5c3ba0539a7703f1","tests/fixtures/attributes.yaml":"c1a9e9a077be13f4bce3330badf6e4656dffe18270a6e576c7f1ec7a8c0f91ea","tests/fixtures/bomb.yaml":"79e68ad7c3fbdff0ccc1389dbbcafa6047e42ef7b9812632824ec40da2624a90","tests/fixtures/context.yaml":"3a4274816c674025e660cdc0bb0c8ace5c60ce76da1b6af9ef4deab41a3d6300","tests/fixtures/defaults.yaml":"343de3158b96386053b25f4b8c6706e8bfbb87f169a8c2705901779a0fdb2dcd","tests/fixtures/errors.yaml":"f3fdfd604d46357757eaa4274ce84f233608ded1a6b58d3937fa6eaf4b32b5d2","tests/fixtures/functions.yaml":"2ea0d184b335b160b144eac62ed0fc0c050ae55789101f2dbd889c5e7a5e0fb1","tests/fixtures/functions_runtime.yaml":"9c8b323a8576964e5e78dba229049f073bb91e5d52eccb984b21aef7d3733c1f","tests/fixtures/isolating.yaml":"434275b1f0216de8e7625a1001aa6ad864335bac7089793566f603e2b8c645f4","tests/fixtures/literals.yaml":"e2799ab6b6a3e801aa399cf8a4da2771b0d8d575cbe7c1b9446f079df578c38c","tests/fixtures/macros.yaml":"52e73a07acbf506150664782aef8d2ccb381d9923d0805ee83aa66f4d376ae1f","tests/fixtures/patterns.yaml":"4884dd97e0a5afa82fb7b3677a8367d106ccb12c3912fed47283bc55f83a0e2f","tests/fixtures/primitives.yaml":"3aabe21281ba9979fbba65de3982958fb299c902503e62d9e074d47e3a6f287c","tests/fixtures/select_expression.yaml":"826e1cc596fe1dfbdf9ca12c66970107bc0dbec753fb709c04855c0e4aec815f","tests/fixtures/transform.yaml":"dfba06cfc24ab3b13a29379330068daffa35e6a063ffe246b38cd9a15f48f22c","tests/fixtures/values_format.yaml":"fe44d043e6e2b4719248a7a4c9eaa743a3306cfeb4557928a1db86bec05c3f91","tests/fixtures/values_ref.yaml":"48a96ab6cb55bc7d7cab001802c6d3f05534c448eb0034130890190ab78affa2","tests/helpers/mod.rs":"e15003eda42ecf9ffc49b4e80d89711d9a04f6d5027809314dbcb7019636e375","tests/resolver_fixtures.rs":"877ddc5decf598b2bd56a97126f9868f520490cb45b58c99902b431f106cbbc7","tests/types_test.rs":"d16a8d449b5740a0f7e558043446f28c38804b47cb744e6eaf327f0342718f5c"},"package":"27ade33328521266c81cc0924523988f43ccd7359f64689a1b6e818afca3a646"} \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/CHANGELOG.md b/third_party/rust/fluent-bundle/CHANGELOG.md new file mode 100644 index 000000000000..88f920f8a201 --- /dev/null +++ b/third_party/rust/fluent-bundle/CHANGELOG.md @@ -0,0 +1,145 @@ +# Changelog + +## Unreleased + + - … + +## fluent-bundle 0.11.0 (March 10, 2020) + - Separate out `concurrent` version of `FluentBundle`. + - Switch FluentBundle functions to use function pointers. + +## fluent-bundle 0.10.2 (February 20, 2020) + - Update to `intl_memoizer` 0.3.0 to allow for Send+Sync on FluentBundle. + +## fluent-bundle 0.10.1 (February 15, 2020) + - Switch RefCell in FluentBundle to Mutex. + +## fluent-bundle 0.10.0 (February 13, 2020) + - Update `fluent-langneg` to 0.12. + - Update `intl_pluralrules` to 6.0. + - Update `unic-langid` to 0.8. + - Introduce `intl-memoizer`. + - Improve the ergonomics of FluentArgs. + - Add `add_resource_overriding`. + - Remove dependency on `failure`. + - Switch the strategy to mitigate bomb attack to limit the number of placeables. + - Introduce `FluentType` for custom types. + - Improve ergonomics of `FluentNumber` and bring its features closer to ECMA402 Intl.NumberFormat. + +## fluent-bundle 0.9.0 (November 26, 2019) + - Update `unic-langid` to 0.7. + - Update `fluent-langneg` to 0.11. + - Update `intl_pluralrules` to 5.0. + +## fluent-bundle 0.8.0 (October 3, 2019) + + - Update `unic-langid` to 0.6. + - Update `fluent-locale` to 0.10. + +## fluent-bundle 0.7.2 (October 1, 2019) + + - Update `unic-langid` to 0.5. + - Update `fluent-locale` to 0.9. + - Stop using macros to cut on compilation time and dependencies. + +## fluent-bundle 0.7.1 (August 1, 2019) + + - Fix FluentBundle::default to use isolating by default. + +## fluent-bundle 0.7.0 (August 1, 2019) + + - Turn FluentBundle to be a generic over Borrow (#114) + - Update FluentBundle to the latest API (0.14) (#120) + - Switch to unic_langid for Language Identifier Management + - Refactor FluentArgs (#130) + - Add transform to FluentBundle to enable pseudolocalization (#131) + - Refactor resolver errors to provide better fallbacking and return errors out of formatting (#93) + - Enable FSI/PDI direction isolation (#116) + - Add more convenience From impls for FluentValue (#108) + - Fix `bare_trait_objects` warnings (#110) + +## fluent-bundle 0.6.0 (March 26, 2019) + + - Update to fluent-syntax 0.9 + - Unify benchmark testsuite with fluent.js + +## fluent-bundle 0.5.0 (January 31, 2019) + + - Update to fluent-syntax 0.8 + - Add unicode escaping + - Align with zero-copy parser + +## fluent 0.4.3 (October 13, 2018) + + - Support Sync+Send in Entry (#70) + +## fluent 0.4.2 (October 1, 2018) + + - Separate lifetimes of `FluentBundle::new` and return values. (#68) + +## fluent 0.4.1 (August 31, 2018) + + - Update README to make the example match new API + +## fluent 0.4.0 (August 31, 2018) + + - Rename MessageContext to FluentBundle + - Update the FluentBundle API to match fluent.js 0.8 + - Update intl-pluralrules to 1.0 + - Add FluentBundle::format_message + - Add FluentResource for external resource caching + - Update fluent-syntax to 0.1.1 + - Update the signature of FluentBundle::format and FluentBundle::format_message + +## fluent 0.3.1 (August 6, 2018) + + - Update `fluent-locale` to 0.4.1. + - Switch MessageContext::locales to be an owned Vec\ + - Switch FluentValue::From\ to FluentValue::From\ + +## fluent 0.3.0 (August 3, 2018) + + - Add support for custom functions in MessageContext. (#50) + - Switch error handling to `annotate-snippets crate`. + - Separate `fluent` and `fluent-syntax` crates. + - Handle cyclic references. (#55) + - Switch parser binary to use `clap`. + - Switch plural rules handling to `intl_pluralrules`. (#56) + - Add `FluentValue::as_number` + - Move `IntlPluralRules` initialization into `MessageContext::new` + - General cleanups in line with `cargo fmt` and `cargo clippy` + +## fluent 0.2.0 (February 11, 2018) + + - Support Rust 1.23 stable + - Support Fluent 0.5 syntax + - Dual-license Apache 2.0 and MIT + +## fluent 0.1.2 (October 14, 2017) + + - Add more complex PluralRules support + +## fluent 0.1.0 (October 13, 2017) + + - Support parsing Fluent Syntax 0.3. + - Support formatting Messages and Attributes alike. + - Support string- and Number-typed external arguments + - Select expressions: + - without a selector. + - with literal strings and numbers as selector, + - with external arguments as selector, + - with message reference as selector (using tags). + - Support matching numbers in select expression to plural categories. + - Only a single mock plural rule has been implemented for now. + - Support Attribute expressions. + - Support Variant expressions. + - `MessageContext::new` now takes a slice as the `locales` argument. + - Added integration with Travis CI and Coveralls. + - Expanded module documentation. + + +## fluent 0.0.1 (January 17, 2017) + + - This is the first release to be listed in the CHANGELOG. + - Basic parser support for the FTL syntax. + - Message references. diff --git a/third_party/rust/fluent-bundle/Cargo.lock b/third_party/rust/fluent-bundle/Cargo.lock new file mode 100644 index 000000000000..2ed93ad4f032 --- /dev/null +++ b/third_party/rust/fluent-bundle/Cargo.lock @@ -0,0 +1,855 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "bstr" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502ae1441a0a5adb8fbd38a5955a6416b9493e92b465de5e4a9bde6a539c2c48" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f359dc14ff8911330a51ef78022d376f25ed00248912803b58f00cb1c27f742" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" + +[[package]] +name = "c2-chacha" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" +dependencies = [ + "ppv-lite86", +] + +[[package]] +name = "cast" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" +dependencies = [ + "rustc_version", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "clap" +version = "2.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" +dependencies = [ + "bitflags", + "textwrap", + "unicode-width", +] + +[[package]] +name = "criterion" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc755679c12bda8e5523a71e4d654b6bf2e14bd838dfc48cde6559a05caf7d1" +dependencies = [ + "atty", + "cast", + "clap", + "criterion-plot", + "csv", + "itertools", + "lazy_static", + "num-traits", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01e15e0ea58e8234f96146b1f91fa9d0e4dd7a38da93ff7a75d42c0b9d3a545" +dependencies = [ + "cast", + "itertools", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "lazy_static", + "maybe-uninit", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +dependencies = [ + "autocfg", + "cfg-if", + "lazy_static", +] + +[[package]] +name = "csv" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" +dependencies = [ + "bstr", + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +dependencies = [ + "memchr", +] + +[[package]] +name = "dtoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" + +[[package]] +name = "either" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" + +[[package]] +name = "fluent-bundle" +version = "0.11.0" +dependencies = [ + "criterion", + "fluent-langneg", + "fluent-syntax", + "intl-memoizer", + "intl_pluralrules", + "rand", + "rental", + "serde", + "serde_yaml", + "smallvec", + "unic-langid", +] + +[[package]] +name = "fluent-langneg" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe5815efd5542e40841cd34ef9003822352b04c67a70c595c6758597c72e1f56" +dependencies = [ + "unic-langid", +] + +[[package]] +name = "fluent-syntax" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac0f7e83d14cccbf26e165d8881dcac5891af0d85a88543c09dd72ebd31d91ba" + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "getrandom" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hermit-abi" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" +dependencies = [ + "libc", +] + +[[package]] +name = "intl-memoizer" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9867e2d65d82936ef34217ed0f87b639a94384e93a0676158142c861c705391f" +dependencies = [ + "type-map", + "unic-langid", +] + +[[package]] +name = "intl_pluralrules" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d82c14d8eece42c03353e0ce86a4d3f97b1f1cef401e4d962dca6c6214a85002" +dependencies = [ + "tinystr", + "unic-langid", +] + +[[package]] +name = "itertools" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" + +[[package]] +name = "js-sys" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018" + +[[package]] +name = "linked-hash-map" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" + +[[package]] +name = "log" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + +[[package]] +name = "memchr" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" + +[[package]] +name = "memoffset" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" +dependencies = [ + "rustc_version", +] + +[[package]] +name = "num-traits" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "oorandom" +version = "11.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcec7c9c2a95cacc7cd0ecb89d8a8454eca13906f6deb55258ffff0adeb9405" + +[[package]] +name = "plotters" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e3bb8da247d27ae212529352020f3e5ee16e83c0c258061d27b08ab92675eeb" +dependencies = [ + "js-sys", + "num-traits", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" + +[[package]] +name = "proc-macro-hack" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom", + "libc", + "rand_chacha", + "rand_core", + "rand_hc", +] + +[[package]] +name = "rand_chacha" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" +dependencies = [ + "c2-chacha", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rayon" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" +dependencies = [ + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" +dependencies = [ + "crossbeam-deque", + "crossbeam-queue", + "crossbeam-utils", + "lazy_static", + "num_cpus", +] + +[[package]] +name = "regex" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322cf97724bea3ee221b78fe25ac9c46114ebb51747ad5babd51a2fc6a8235a8" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +dependencies = [ + "byteorder", +] + +[[package]] +name = "regex-syntax" +version = "0.6.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1132f845907680735a84409c3bebc64d1364a5683ffbce899550cd09d5eaefc1" + +[[package]] +name = "rental" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f" +dependencies = [ + "rental-impl", + "stable_deref_trait", +] + +[[package]] +name = "rental-impl" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "475e68978dc5b743f2f40d8e0a8fdc83f1c5e78cbf4b8fa5e74e73beebc340de" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" +dependencies = [ + "dtoa", + "linked-hash-map", + "serde", + "yaml-rust", +] + +[[package]] +name = "smallvec" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" + +[[package]] +name = "stable_deref_trait" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" + +[[package]] +name = "syn" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "123bd9499cfb380418d509322d7a6d52e5315f064fe4b3ad18a53d6b92c07859" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "tinystr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bac79c4b51eda1b090b1edebfb667821bbb51f713855164dc7cec2cb8ac2ba3" + +[[package]] +name = "tinytemplate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a3c6667d3e65eb1bc3aed6fd14011c6cbc3a0665218ab7f5daf040b9ec371a" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "type-map" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d2741b1474c327d95c1f1e3b0a2c3977c8e128409c572a33af2914e7d636717" +dependencies = [ + "fxhash", +] + +[[package]] +name = "unic-langid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d81136159f779c35b10655f45210c71cd5ca5a45aadfe9840a61c7071735ed" +dependencies = [ + "unic-langid-impl", + "unic-langid-macros", +] + +[[package]] +name = "unic-langid-impl" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43c61e94492eb67f20facc7b025778a904de83d953d8fcb60dd9adfd6e2d0ea" +dependencies = [ + "tinystr", +] + +[[package]] +name = "unic-langid-macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49bd90791278634d57e3ed4a4073108e3f79bfb87ab6a7b8664ba097425703df" +dependencies = [ + "proc-macro-hack", + "tinystr", + "unic-langid-impl", + "unic-langid-macros-impl", +] + +[[package]] +name = "unic-langid-macros-impl" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0098f77bd754f8fb7850cdf4ab143aa821898c4ac6dc16bcb2aa3e62ce858d1" +dependencies = [ + "proc-macro-hack", + "quote", + "syn", + "unic-langid-impl", +] + +[[package]] +name = "unicode-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" + +[[package]] +name = "walkdir" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasm-bindgen" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0da9c9a19850d3af6df1cb9574970b566d617ecfaf36eb0b706b6f3ef9bd2f8" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f6fde1d36e75a714b5fe0cffbb78978f222ea6baebb726af13c78869fdb4205" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25bda4168030a6412ea8a047e27238cadf56f0e53516e1e83fec0a8b7c786f6d" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8" + +[[package]] +name = "web-sys" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "yaml-rust" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" +dependencies = [ + "linked-hash-map", +] diff --git a/third_party/rust/fluent-bundle/Cargo.toml b/third_party/rust/fluent-bundle/Cargo.toml index c1a2e033f8e6..c288ab7b4b99 100644 --- a/third_party/rust/fluent-bundle/Cargo.toml +++ b/third_party/rust/fluent-bundle/Cargo.toml @@ -13,9 +13,8 @@ [package] edition = "2018" name = "fluent-bundle" -version = "0.12.0" +version = "0.11.0" authors = ["Zibi Braniecki ", "Staś Małolepszy "] -include = ["src/**/*", "benches/*.rs", "Cargo.toml", "README.md"] description = "A localization system designed to unleash the entire expressive power of\nnatural language translations.\n" homepage = "http://www.projectfluent.org" readme = "README.md" @@ -28,16 +27,16 @@ repository = "https://github.com/projectfluent/fluent-rs" name = "resolver" harness = false [dependencies.fluent-langneg] -version = "0.13" +version = "0.12" [dependencies.fluent-syntax] version = "0.9" [dependencies.intl-memoizer] -version = "0.5" +version = "0.4" [dependencies.intl_pluralrules] -version = "7.0" +version = "6.0" [dependencies.rental] version = "0.5" @@ -46,7 +45,7 @@ version = "0.5" version = "1.0" [dependencies.unic-langid] -version = "0.9" +version = "0.8" [dev-dependencies.criterion] version = "0.3" @@ -61,5 +60,5 @@ features = ["derive"] version = "0.8" [dev-dependencies.unic-langid] -version = "0.9" +version = "0.8" features = ["macros"] diff --git a/third_party/rust/fluent-bundle/benches/menubar.ftl b/third_party/rust/fluent-bundle/benches/menubar.ftl new file mode 100644 index 000000000000..5aa2b2322e94 --- /dev/null +++ b/third_party/rust/fluent-bundle/benches/menubar.ftl @@ -0,0 +1,318 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +## browser/locales/en-US/browser/menubar.ftl + +## File menu + +file-menu = + .label = File + .accesskey = F +tab-cmd = + .label = New Tab + .accesskey = T +new-user-context = + .label = New Container Tab + .accesskey = B +new-navigator-cmd = + .label = New Window + .accesskey = N +new-private-window = + .label = New Private Window + .accesskey = W + +# Only displayed on OS X, and only on windows that aren't main browser windows, +# or when there are no windows but Firefox is still running. +open-location-cmd = + .label = Open Location… +open-file-cmd = + .label = Open File… + .accesskey = O +close-cmd = + .label = Close + .accesskey = C +close-window = + .label = Close Window + .accesskey = d +save-page-cmd = + .label = Save Page As… + .accesskey = A +email-page-cmd = + .label = Email Link… + .accesskey = E +print-setup-cmd = + .label = Page Setup… + .accesskey = u +print-preview-cmd = + .label = Print Preview + .accesskey = v +print-cmd = + .label = Print… + .accesskey = P +go-offline-cmd = + .label = Work Offline + .accesskey = k +quit-application-cmd = + .label = Quit + .accesskey = Q + +## Edit menu + +edit-menu = + .label = Edit + .accesskey = E +undo-cmd = + .label = Undo + .accesskey = U +redo-cmd = + .label = Redo + .accesskey = R +cut-cmd = + .label = Cut + .accesskey = t +copy-cmd = + .label = Copy + .accesskey = C +paste-cmd = + .label = Paste + .accesskey = P +delete-cmd = + .label = Delete + .accesskey = D +select-all-cmd = + .label = Select All + .accesskey = A +find-on-cmd = + .label = Find in This Page… + .accesskey = F +find-again-cmd = + .label = Find Again + .accesskey = g +bidi-switch-text-direction-item = + .label = Switch Text Direction + .accesskey = w +preferences-cmd-unix = + .label = Preferences + .accesskey = n + +## View menu + +view-menu = + .label = View + .accesskey = V +view-toolbars-menu = + .label = Toolbars + .accesskey = T +view-customize-toolbar = + .label = Customize… + .accesskey = C +view-sidebar-menu = + .label = Sidebar + .accesskey = e +bookmarks-button = + .label = Bookmarks +history-button = + .label = History +synced-tabs = + .label = Synced Tabs +full-zoom = + .label = Zoom + .accesskey = Z +full-zoom-enlarge-cmd = + .label = Zoom In + .accesskey = I +full-zoom-reduce-cmd = + .label = Zoom Out + .accesskey = O +full-zoom-reset-cmd = + .label = Reset + .accesskey = R +full-zoom-toggle-cmd = + .label = Zoom Text Only + .accesskey = T +page-style-menu = + .label = Page Style + .accesskey = y +page-style-no-style = + .label = No Style + .accesskey = n +page-style-persistent-only = + .label = Basic Page Style + .accesskey = b +charset-menu2 = + .label = Text Encoding + .accesskey = c + +## Full Screen controls +## Match what Safari and other Apple applications use on OS X Lion. +# +enter-full-screen-cmd = + .accesskey = F + .label = Enter Full Screen +exit-full-screen-cmd = + .accesskey = F + .label = Exit Full Screen +full-screen-cmd = + .accesskey = F + .label = Full Screen +show-all-tabs-cmd = + .accesskey = A + .label = Show All Tabs +bidi-switch-page-direction-item = + .label = Switch Page Direction + .accesskey = D + +## History menu + +history-menu = + .label = History + .accesskey = s +show-all-history-cmd2 = + .label = Show All History +clear-recent-history = + .label = Clear Recent History… +sync-tabs-menu3 = + .label = Synced Tabs +history-restore-last-session = + .label = Restore Previous Session +hidden-tabs = + .label = Hidden Tabs +history-undo-menu = + .label = Recently Closed Tabs +history-undo-window-menu = + .label = Recently Closed Windows + +## Bookmarks menu + +bookmarks-menu = + .label = Bookmarks + .accesskey = B +show-all-bookmarks2 = + .label = Show All Bookmarks +add-cur-pages-cmd = + .label = Bookmark All Tabs… +personalbar-cmd = + .label = Bookmarks Toolbar +other-bookmarks-cmd = + .label = Other Bookmarks +mobile-bookmarks-cmd = + .label = Mobile Bookmarks + +## Tools menu + +tools-menu = + .label = Tools + .accesskey = T +downloads = + .label = Downloads + .accesskey = D +addons = + .label = Add-ons + .accesskey = A +sync-sign-in = + .label = Sign In To { -sync-brand-short-name }… + .accesskey = Y +sync-sync-now-item = + .label = Sync Now + .accesskey = S +sync-re-auth-item = + .label = Reconnect to { -sync-brand-short-name }… + .accesskey = R +web-developer-menu = + .label = Web Developer + .accesskey = W +page-source-cmd = + .label = Page Source + .accesskey = o +page-info-cmd = + .accesskey = I + .label = Page Info +preferences-cmd2 = + .label = Options + .accesskey = O +preferences-ldb-cmd = + .label = Layout Debugger + .accesskey = L +preferences-cmd-mac = + .label = Preferences… +services-menu-mac = + .label = Services +hide-this-app-cmd-mac2 = + .label = Hide { -brand-shorter-name } +hide-other-apps-cmd-mac = + .label = Hide Others +show-all-apps-cmd-mac = + .label = Show All +window-menu = + .label = Window +bring-all-to-front = + .label = Bring All to Front +help-menu = + .label = Help + .accesskey = H +product-help2 = + .label = { -brand-shorter-name } Help + .accesskey = H +help-show-tour2 = + .label = { -brand-shorter-name } Tour + .accesskey = o +help-keyboard-shortcuts = + .label = Keyboard Shortcuts + .accesskey = K +help-troubleshooting-info = + .accesskey = T + .label = Troubleshooting Information +help-feedback-page = + .accesskey = S + .label = Submit Feedback… +help-safe-mode = + .accesskey = R + .label = Restart with Add-ons Disabled… + .stopaccesskey = R + .stoplabel = Restart with Add-ons Enabled +report-deceptive-site-menu = + .label = Report Deceptive Site… + .accesskey = D +safeb = + .label = This isn’t a deceptive site… + .accesskey = d +about-product2 = + .accesskey = A + .label = About { -brand-shorter-name } + +# browser/locales/en-US/browser/toolbar.ftl + +urlbar-textbox = + .placeholder = Search or enter address + .accesskey = d + + +## Toolbar items + +view-bookmarks-broadcaster = + .label = Bookmarks +view-bookmarks-key = + .key = b +view-bookmarks-key-win = + .key = i + +view-history-broadcaster = + .label = History +view-history-key = + .key = h +view-tabs-broadcaster = + .label = Synced Tabs + + +# browser/branding/official/locales/en-US/brand.ftl + +-brand-shorter-name = Firefox +-brand-short-name = Firefox +-brand-full-name = Mozilla Firefox +-vendor-short-name = Mozilla + +trademark-info = + Firefox and the Firefox logos are trademarks of the Mozilla Foundation. + +-sync-brand-short-name = Sync diff --git a/third_party/rust/fluent-bundle/benches/preferences.ftl b/third_party/rust/fluent-bundle/benches/preferences.ftl new file mode 100644 index 000000000000..b85b4b094ebe --- /dev/null +++ b/third_party/rust/fluent-bundle/benches/preferences.ftl @@ -0,0 +1,1077 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +## browser/locales/en-US/browser/preferences/preferences.ftl + +do-not-track-description = Send websites a “Do Not Track” signal that you don’t want to be tracked +do-not-track-learn-more = Learn more +do-not-track-option-default-content-blocking-known = + .label = Only when { -brand-short-name } is set to block known trackers +do-not-track-option-always = + .label = Always + +pref-page = + .title = + { PLATFORM() -> + [windows] Options + *[other] Preferences + } + +# This is used to determine the width of the search field in about:preferences, +# in order to make the entire placeholder string visible +# +# Please keep the placeholder string short to avoid truncation. +# +# Notice: The value of the `.style` attribute is a CSS string, and the `width` +# is the name of the CSS property. It is intended only to adjust the element's width. +# Do not translate. +search-input-box = + .style = width: 15.4em + .placeholder = + { PLATFORM() -> + [windows] Find in Options + *[other] Find in Preferences + } + +policies-notice = + { PLATFORM() -> + [windows] Your organization has disabled the ability to change some options. + *[other] Your organization has disabled the ability to change some preferences. + } + +pane-general-title = General +category-general = + .tooltiptext = { pane-general-title } + +pane-home-title = Home +category-home = + .tooltiptext = { pane-home-title } + +pane-search-title = Search +category-search = + .tooltiptext = { pane-search-title } + +pane-privacy-title = Privacy & Security +category-privacy = + .tooltiptext = { pane-privacy-title } + +pane-sync-title2 = { -sync-brand-short-name } +category-sync2 = + .tooltiptext = { pane-sync-title2 } + +help-button-label = { -brand-short-name } Support +addons-button-label = Extensions & Themes + +focus-search = + .key = f + +close-button = + .aria-label = Close + +## Browser Restart Dialog + +feature-enable-requires-restart = { -brand-short-name } must restart to enable this feature. +feature-disable-requires-restart = { -brand-short-name } must restart to disable this feature. +should-restart-title = Restart { -brand-short-name } +should-restart-ok = Restart { -brand-short-name } now +cancel-no-restart-button = Cancel +restart-later = Restart Later + +## Extension Control Notifications +## +## These strings are used to inform the user +## about changes made by extensions to browser settings. +## +## is going to be replaced by the extension icon. +## +## Variables: +## $name (String): name of the extension + +# This string is shown to notify the user that their home page +# is being controlled by an extension. +extension-controlled-homepage-override = An extension, { $name }, is controlling your home page. + +# This string is shown to notify the user that their new tab page +# is being controlled by an extension. +extension-controlled-new-tab-url = An extension, { $name }, is controlling your New Tab page. + +# This string is shown to notify the user that their notifications permission +# is being controlled by an extension. +extension-controlled-web-notifications= An extension, { $name }, is controlling this setting. + +# This string is shown to notify the user that the default search engine +# is being controlled by an extension. +extension-controlled-default-search = An extension, { $name }, has set your default search engine. + +# This string is shown to notify the user that Container Tabs +# are being enabled by an extension. +extension-controlled-privacy-containers = An extension, { $name }, requires Container Tabs. + +# This string is shown to notify the user that their content blocking "All Detected Trackers" +# preferences are being controlled by an extension. +extension-controlled-websites-content-blocking-all-trackers = An extension, { $name }, is controlling this setting. + +# This string is shown to notify the user that their proxy configuration preferences +# are being controlled by an extension. +extension-controlled-proxy-config = An extension, { $name }, is controlling how { -brand-short-name } connects to the internet. + +# This string is shown after the user disables an extension to notify the user +# how to enable an extension that they disabled. +# +# will be replaced with Add-ons icon +# will be replaced with Menu icon +extension-controlled-enable = To enable the extension go to Add-ons in the menu. + +## Preferences UI Search Results + +search-results-header = Search Results + +# `` will be replaced by the search term. +search-results-empty-message = + { PLATFORM() -> + [windows] Sorry! There are no results in Options for “”. + *[other] Sorry! There are no results in Preferences for “”. + } + +search-results-help-link = Need help? Visit { -brand-short-name } Support + +## General Section + +startup-header = Startup + +# { -brand-short-name } will be 'Firefox Developer Edition', +# since this setting is only exposed in Firefox Developer Edition +separate-profile-mode = + .label = Allow { -brand-short-name } and Firefox to run at the same time +use-firefox-sync = Tip: This uses separate profiles. Use { -sync-brand-short-name } to share data between them. +get-started-not-logged-in = Sign in to { -sync-brand-short-name }… +get-started-configured = Open { -sync-brand-short-name } preferences + +always-check-default = + .label = Always check if { -brand-short-name } is your default browser + .accesskey = y + +is-default = { -brand-short-name } is currently your default browser +is-not-default = { -brand-short-name } is not your default browser + +set-as-my-default-browser = + .label = Make Default… + .accesskey = D + +startup-restore-previous-session = + .label = Restore previous session + .accesskey = s + +startup-restore-warn-on-quit = + .label = Warn you when quitting the browser + +disable-extension = + .label = Disable Extension + +tabs-group-header = Tabs + +ctrl-tab-recently-used-order = + .label = Ctrl+Tab cycles through tabs in recently used order + .accesskey = T + +open-new-link-as-tabs = + .label = Open links in tabs instead of new windows + .accesskey = w + +warn-on-close-multiple-tabs = + .label = Warn you when closing multiple tabs + .accesskey = m + +warn-on-open-many-tabs = + .label = Warn you when opening multiple tabs might slow down { -brand-short-name } + .accesskey = d + +switch-links-to-new-tabs = + .label = When you open a link in a new tab, switch to it immediately + .accesskey = h + +show-tabs-in-taskbar = + .label = Show tab previews in the Windows taskbar + .accesskey = k + +browser-containers-enabled = + .label = Enable Container Tabs + .accesskey = n + +browser-containers-learn-more = Learn more + +browser-containers-settings = + .label = Settings… + .accesskey = i + +containers-disable-alert-title = Close All Container Tabs? +containers-disable-alert-desc = + { $tabCount -> + [one] If you disable Container Tabs now, { $tabCount } container tab will be closed. Are you sure you want to disable Container Tabs? + *[other] If you disable Container Tabs now, { $tabCount } container tabs will be closed. Are you sure you want to disable Container Tabs? + } + +containers-disable-alert-ok-button = + { $tabCount -> + [one] Close { $tabCount } Container Tab + *[other] Close { $tabCount } Container Tabs + } +containers-disable-alert-cancel-button = Keep enabled + +containers-remove-alert-title = Remove This Container? + +# Variables: +# $count (Number) - Number of tabs that will be closed. +containers-remove-alert-msg = + { $count -> + [one] If you remove this Container now, { $count } container tab will be closed. Are you sure you want to remove this Container? + *[other] If you remove this Container now, { $count } container tabs will be closed. Are you sure you want to remove this Container? + } + +containers-remove-ok-button = Remove this Container +containers-remove-cancel-button = Don’t remove this Container + + +## General Section - Language & Appearance + +language-and-appearance-header = Language and Appearance + +fonts-and-colors-header = Fonts & Colors + +default-font = Default font + .accesskey = D +default-font-size = Size + .accesskey = S + +advanced-fonts = + .label = Advanced… + .accesskey = A + +colors-settings = + .label = Colors… + .accesskey = C + +language-header = Language + +choose-language-description = Choose your preferred language for displaying pages + +choose-button = + .label = Choose… + .accesskey = o + +choose-browser-language-description = Choose the languages used to display menus, messages, and notifications from { -brand-short-name }. +manage-browser-languages-button = + .label = Set Alternatives… + .accesskey = l +confirm-browser-language-change-description = Restart { -brand-short-name } to apply these changes +confirm-browser-language-change-button = Apply and Restart + +translate-web-pages = + .label = Translate web content + .accesskey = T + +# The element is replaced by the logo of the provider +# used to provide machine translations for web pages. +translate-attribution = Translations by + +translate-exceptions = + .label = Exceptions… + .accesskey = x + +check-user-spelling = + .label = Check your spelling as you type + .accesskey = t + +## General Section - Files and Applications + +files-and-applications-title = Files and Applications + +download-header = Downloads + +download-save-to = + .label = Save files to + .accesskey = v + +download-choose-folder = + .label = + { PLATFORM() -> + [macos] Choose… + *[other] Browse… + } + .accesskey = + { PLATFORM() -> + [macos] e + *[other] o + } + +download-always-ask-where = + .label = Always ask you where to save files + .accesskey = A + +applications-header = Applications + +applications-description = Choose how { -brand-short-name } handles the files you download from the web or the applications you use while browsing. + +applications-filter = + .placeholder = Search file types or applications + +applications-type-column = + .label = Content Type + .accesskey = T + +applications-action-column = + .label = Action + .accesskey = A + +drm-content-header = Digital Rights Management (DRM) Content + +play-drm-content = + .label = Play DRM-controlled content + .accesskey = P + +play-drm-content-learn-more = Learn more + +update-application-title = { -brand-short-name } Updates + +update-application-description = Keep { -brand-short-name } up to date for the best performance, stability, and security. + +update-application-version = Version { $version } What’s new + +update-history = + .label = Show Update History… + .accesskey = p + +update-application-allow-description = Allow { -brand-short-name } to + +update-application-auto = + .label = Automatically install updates (recommended) + .accesskey = A + +update-application-check-choose = + .label = Check for updates but let you choose to install them + .accesskey = C + +update-application-manual = + .label = Never check for updates (not recommended) + .accesskey = N + +update-application-warning-cross-user-setting = This setting will apply to all Windows accounts and { -brand-short-name } profiles using this installation of { -brand-short-name }. + +update-application-use-service = + .label = Use a background service to install updates + .accesskey = b + +update-enable-search-update = + .label = Automatically update search engines + .accesskey = e + +update-pref-write-failure-title = Write Failure + +# Variables: +# $path (String) - Path to the configuration file +update-pref-write-failure-message = Unable to save preference. Could not write to file: { $path } + +## General Section - Performance + +performance-title = Performance + +performance-use-recommended-settings-checkbox = + .label = Use recommended performance settings + .accesskey = U + +performance-use-recommended-settings-desc = These settings are tailored to your computer’s hardware and operating system. + +performance-settings-learn-more = Learn more + +performance-allow-hw-accel = + .label = Use hardware acceleration when available + .accesskey = r + +performance-limit-content-process-option = Content process limit + .accesskey = l + +performance-limit-content-process-enabled-desc = Additional content processes can improve performance when using multiple tabs, but will also use more memory. +performance-limit-content-process-blocked-desc = Modifying the number of content processes is only possible with multiprocess { -brand-short-name }. Learn how to check if multiprocess is enabled + +# Variables: +# $num - default value of the `dom.ipc.processCount` pref. +performance-default-content-process-count = + .label = { $num } (default) + +## General Section - Browsing + +browsing-title = Browsing + +browsing-use-autoscroll = + .label = Use autoscrolling + .accesskey = a + +browsing-use-smooth-scrolling = + .label = Use smooth scrolling + .accesskey = m + +browsing-use-onscreen-keyboard = + .label = Show a touch keyboard when necessary + .accesskey = c + +browsing-use-cursor-navigation = + .label = Always use the cursor keys to navigate within pages + .accesskey = k + +browsing-search-on-start-typing = + .label = Search for text when you start typing + .accesskey = x + +browsing-cfr-recommendations = + .label = Recommend extensions as you browse + .accesskey = R +browsing-cfr-features = + .label = Recommend features as you browse + .accesskey = f + +browsing-cfr-recommendations-learn-more = Learn more + +## General Section - Proxy + +network-settings-title = Network Settings + +network-proxy-connection-description = Configure how { -brand-short-name } connects to the internet. + +network-proxy-connection-learn-more = Learn more + +network-proxy-connection-settings = + .label = Settings… + .accesskey = e + +## Home Section + +home-new-windows-tabs-header = New Windows and Tabs + +home-new-windows-tabs-description2 = Choose what you see when you open your homepage, new windows, and new tabs. + +## Home Section - Home Page Customization + +home-homepage-mode-label = Homepage and new windows + +home-newtabs-mode-label = New tabs + +home-restore-defaults = + .label = Restore Defaults + .accesskey = R + +# "Firefox" should be treated as a brand and kept in English, +# while "Home" and "(Default)" can be localized. +home-mode-choice-default = + .label = Firefox Home (Default) + +home-mode-choice-custom = + .label = Custom URLs… + +home-mode-choice-blank = + .label = Blank Page + +home-homepage-custom-url = + .placeholder = Paste a URL… + +# This string has a special case for '1' and [other] (default). If necessary for +# your language, you can add {$tabCount} to your translations and use the +# standard CLDR forms, or only use the form for [other] if both strings should +# be identical. +use-current-pages = + .label = + { $tabCount -> + [1] Use Current Page + *[other] Use Current Pages + } + .accesskey = C + +choose-bookmark = + .label = Use Bookmark… + .accesskey = B + +## Search Section + +search-bar-header = Search Bar +search-bar-hidden = + .label = Use the address bar for search and navigation +search-bar-shown = + .label = Add search bar in toolbar + +search-engine-default-header = Default Search Engine +search-engine-default-desc = Choose the default search engine to use in the address bar and search bar. + +search-suggestions-option = + .label = Provide search suggestions + .accesskey = s + +search-show-suggestions-url-bar-option = + .label = Show search suggestions in address bar results + .accesskey = l + +# This string describes what the user will observe when the system +# prioritizes search suggestions over browsing history in the results +# that extend down from the address bar. In the original English string, +# "ahead" refers to location (appearing most proximate to), not time +# (appearing before). +search-show-suggestions-above-history-option = + .label = Show search suggestions ahead of browsing history in address bar results + +search-suggestions-cant-show = Search suggestions will not be shown in location bar results because you have configured { -brand-short-name } to never remember history. + +search-one-click-header = One-Click Search Engines + +search-one-click-desc = Choose the alternative search engines that appear below the address bar and search bar when you start to enter a keyword. + +search-choose-engine-column = + .label = Search Engine +search-choose-keyword-column = + .label = Keyword + +search-restore-default = + .label = Restore Default Search Engines + .accesskey = D + +search-remove-engine = + .label = Remove + .accesskey = R + +search-find-more-link = Find more search engines + +# This warning is displayed when the chosen keyword is already in use +# ('Duplicate' is an adjective) +search-keyword-warning-title = Duplicate Keyword +# Variables: +# $name (String) - Name of a search engine. +search-keyword-warning-engine = You have chosen a keyword that is currently in use by “{ $name }”. Please select another. +search-keyword-warning-bookmark = You have chosen a keyword that is currently in use by a bookmark. Please select another. + +## Containers Section + +containers-back-link = « Go Back +containers-header = Container Tabs +containers-add-button = + .label = Add New Container + .accesskey = A + +containers-preferences-button = + .label = Preferences +containers-remove-button = + .label = Remove + +## Sync Section - Signed out + +sync-signedout-caption = Take Your Web With You +sync-signedout-description = Synchronize your bookmarks, history, tabs, passwords, add-ons, and preferences across all your devices. + +sync-signedout-account-title = Connect with a { -fxaccount-brand-name } +sync-signedout-account-create = Don’t have an account? Get started + .accesskey = c + +sync-signedout-account-signin = + .label = Sign In… + .accesskey = I + +# This message contains two links and two icon images. +# `` - Android logo icon +# `` - Link to Android Download +# `` - iOS logo icon +# `` - Link to iOS Download +# +# They can be moved within the sentence as needed to adapt +# to your language, but should not be changed or translated. +sync-mobile-promo = Download Firefox for Android or iOS to sync with your mobile device. + +## Sync Section - Signed in + +sync-profile-picture = + .tooltiptext = Change profile picture + +sync-disconnect = + .label = Disconnect… + .accesskey = D + +sync-manage-account = Manage account + .accesskey = o + +sync-signedin-unverified = { $email } is not verified. +sync-signedin-login-failure = Please sign in to reconnect { $email } + +sync-resend-verification = + .label = Resend Verification + .accesskey = d + +sync-remove-account = + .label = Remove Account + .accesskey = R + +sync-sign-in = + .label = Sign in + .accesskey = g + +sync-signedin-settings-header = Sync Settings +sync-signedin-settings-desc = Choose what to synchronize on your devices using { -brand-short-name } + +sync-engine-bookmarks = + .label = Bookmarks + .accesskey = m + +sync-engine-history = + .label = History + .accesskey = r + +sync-engine-tabs = + .label = Open tabs + .tooltiptext = A list of what’s open on all synced devices + .accesskey = t + +sync-engine-logins = + .label = Logins + .tooltiptext = Usernames and passwords you’ve saved + .accesskey = L + +sync-engine-addresses = + .label = Addresses + .tooltiptext = Postal addresses you’ve saved (desktop only) + .accesskey = e + +sync-engine-creditcards = + .label = Credit cards + .tooltiptext = Names, numbers and expiry dates (desktop only) + .accesskey = C + +sync-engine-addons = + .label = Add-ons + .tooltiptext = Extensions and themes for Firefox desktop + .accesskey = A + +sync-engine-prefs = + .label = + { PLATFORM() -> + [windows] Options + *[other] Preferences + } + .tooltiptext = General, Privacy, and Security settings you’ve changed + .accesskey = s + +sync-device-name-header = Device Name + +sync-device-name-change = + .label = Change Device Name… + .accesskey = h + +sync-device-name-cancel = + .label = Cancel + .accesskey = n + +sync-device-name-save = + .label = Save + .accesskey = v + +sync-connect-another-device = Connect another device + +sync-manage-devices = Manage devices + +sync-fxa-begin-pairing = Pair a device + +sync-tos-link = Terms of Service + +sync-fxa-privacy-notice = Privacy Notice + +## Privacy Section + +privacy-header = Browser Privacy + +## Privacy Section - Forms + +logins-header = Logins & Passwords +forms-ask-to-save-logins = + .label = Ask to save logins and passwords for websites + .accesskey = r +forms-exceptions = + .label = Exceptions… + .accesskey = x +forms-saved-logins = + .label = Saved Logins… + .accesskey = L +forms-master-pw-use = + .label = Use a master password + .accesskey = U +forms-master-pw-change = + .label = Change Master Password… + .accesskey = M + +## Privacy Section - History + +history-header = History + +# This label is followed, on the same line, by a dropdown list of options +# (Remember history, etc.). +# In English it visually creates a full sentence, e.g. +# "Firefox will" + "Remember history". +# +# If this doesn't work for your language, you can translate this message: +# - Simply as "Firefox", moving the verb into each option. +# This will result in "Firefox" + "Will remember history", etc. +# - As a stand-alone message, for example "Firefox history settings:". +history-remember-label = { -brand-short-name } will + .accesskey = w + +history-remember-option-all = + .label = Remember history +history-remember-option-never = + .label = Never remember history +history-remember-option-custom = + .label = Use custom settings for history + +history-remember-description = { -brand-short-name } will remember your browsing, download, form and search history. +history-dontremember-description = { -brand-short-name } will use the same settings as private browsing, and will not remember any history as you browse the Web. + +history-private-browsing-permanent = + .label = Always use private browsing mode + .accesskey = p + +history-remember-browser-option = + .label = Remember browsing and download history + .accesskey = b + +history-remember-search-option = + .label = Remember search and form history + .accesskey = f + +history-clear-on-close-option = + .label = Clear history when { -brand-short-name } closes + .accesskey = r + +history-clear-on-close-settings = + .label = Settings… + .accesskey = t + +history-clear-button = + .label = Clear History… + .accesskey = s + +## Privacy Section - Site Data + +sitedata-header = Cookies and Site Data + +sitedata-total-size-calculating = Calculating site data and cache size… + +# Variables: +# $value (Number) - Value of the unit (for example: 4.6, 500) +# $unit (String) - Name of the unit (for example: "bytes", "KB") +sitedata-total-size = Your stored cookies, site data and cache are currently using { $value } { $unit } of disk space. + +sitedata-learn-more = Learn more + +sitedata-delete-on-close = + .label = Delete cookies and site data when { -brand-short-name } is closed + .accesskey = c + +sitedata-delete-on-close-private-browsing = In permanent private browsing mode, cookies and site data will always be cleared when { -brand-short-name } is closed. + +sitedata-allow-cookies-option = + .label = Accept cookies and site data + .accesskey = A + +sitedata-disallow-cookies-option = + .label = Block cookies and site data + .accesskey = B + +# This label means 'type of content that is blocked', and is followed by a drop-down list with content types below. +# The list items are the strings named sitedata-block-*-option*. +sitedata-block-desc = Type blocked + .accesskey = T + +sitedata-option-block-trackers = + .label = Third-party trackers +sitedata-option-block-unvisited = + .label = Cookies from unvisited websites +sitedata-option-block-all-third-party = + .label = All third-party cookies (may cause websites to break) +sitedata-option-block-all = + .label = All cookies (will cause websites to break) + +sitedata-clear = + .label = Clear Data… + .accesskey = l + +sitedata-settings = + .label = Manage Data… + .accesskey = M + +sitedata-cookies-permissions = + .label = Manage Permissions… + .accesskey = P + +## Privacy Section - Address Bar + +addressbar-header = Address Bar + +addressbar-suggest = When using the address bar, suggest + +addressbar-locbar-history-option = + .label = Browsing history + .accesskey = h +addressbar-locbar-bookmarks-option = + .label = Bookmarks + .accesskey = k +addressbar-locbar-openpage-option = + .label = Open tabs + .accesskey = O + +addressbar-suggestions-settings = Change preferences for search engine suggestions + +## Privacy Section - Content Blocking + +content-blocking-header = Content Blocking + +content-blocking-description = Block third-party content that tracks you around the web. Control how much of your online activity gets stored and shared between websites. + +content-blocking-learn-more = Learn more + +# The terminology used to refer to categories of Content Blocking is also used in chrome/browser/browser.properties and should be translated consistently. +# "Standard" in this case is an adjective, meaning "default" or "normal". +content-blocking-setting-standard = + .label = Standard + .accesskey = d +content-blocking-setting-strict = + .label = Strict + .accesskey = r +content-blocking-setting-custom = + .label = Custom + .accesskey = C + +content-blocking-standard-description = Only blocks known trackers in Private Windows. +content-blocking-standard-desc = Balanced for protection and performance. Allows some trackers so websites function properly. +content-blocking-strict-desc = Blocks all trackers { -brand-short-name } detects. May cause some sites to break. +content-blocking-custom-desc = Choose what to block. + +content-blocking-private-trackers = Known trackers only in Private Windows +content-blocking-third-party-cookies = Third-party tracking cookies +content-blocking-all-windows-trackers = Known trackers in all windows +content-blocking-all-third-party-cookies = All third-party cookies + +content-blocking-warning-title = Heads up! +content-blocking-warning-description = Blocking content can cause some websites to break. It’s easy to disable blocking for sites you trust. +content-blocking-learn-how = Learn how + +content-blocking-trackers-label = + .label = Trackers + .accesskey = T +content-blocking-tracking-protection-option-all-windows = + .label = In all windows + .accesskey = A +content-blocking-option-private = + .label = Only in Private Windows + .accesskey = p +content-blocking-tracking-protection-change-block-list = Change block list + +content-blocking-cookies-label = + .label = Cookies + .accesskey = C + +# Cryptomining refers to using scripts on websites that can use a computer’s resources to mine cryptocurrency without a user’s knowledge. +content-blocking-cryptominers-label = + .label = Cryptominers + .accesskey = y + +# Browser fingerprinting is a method of tracking users by the configuration and settings information (their "digital fingerprint") +# that is visible to websites they browse, rather than traditional tracking methods such as IP addresses and unique cookies. +content-blocking-fingerprinters-label = + .label = Fingerprinters + .accesskey = F + +## Privacy Section - Tracking + +tracking-manage-exceptions = + .label = Manage Exceptions… + .accesskey = x + +## Privacy Section - Permissions + +permissions-header = Permissions + +permissions-location = Location +permissions-location-settings = + .label = Settings… + .accesskey = t + +permissions-camera = Camera +permissions-camera-settings = + .label = Settings… + .accesskey = t + +permissions-microphone = Microphone +permissions-microphone-settings = + .label = Settings… + .accesskey = t + +permissions-notification = Notifications +permissions-notification-settings = + .label = Settings… + .accesskey = t +permissions-notification-link = Learn more + +permissions-notification-pause = + .label = Pause notifications until { -brand-short-name } restarts + .accesskey = n + +permissions-block-autoplay-media2 = + .label = Block websites from automatically playing sound + .accesskey = B + +permissions-block-autoplay-media-exceptions = + .label = Exceptions… + .accesskey = E + +permissions-block-popups = + .label = Block pop-up windows + .accesskey = B + +permissions-block-popups-exceptions = + .label = Exceptions… + .accesskey = E + +permissions-addon-install-warning = + .label = Warn you when websites try to install add-ons + .accesskey = W + +permissions-addon-exceptions = + .label = Exceptions… + .accesskey = E + +permissions-a11y-privacy-checkbox = + .label = Prevent accessibility services from accessing your browser + .accesskey = a + +permissions-a11y-privacy-link = Learn more + +## Privacy Section - Data Collection + +collection-header = { -brand-short-name } Data Collection and Use + +collection-description = We strive to provide you with choices and collect only what we need to provide and improve { -brand-short-name } for everyone. We always ask permission before receiving personal information. +collection-privacy-notice = Privacy Notice + +collection-health-report = + .label = Allow { -brand-short-name } to send technical and interaction data to { -vendor-short-name } + .accesskey = r +collection-health-report-link = Learn more + +collection-studies = + .label = Allow { -brand-short-name } to install and run studies +collection-studies-link = View { -brand-short-name } studies + +addon-recommendations = + .label = Allow { -brand-short-name } to make personalized extension recommendations +addon-recommendations-link = Learn more + +# This message is displayed above disabled data sharing options in developer builds +# or builds with no Telemetry support available. +collection-health-report-disabled = Data reporting is disabled for this build configuration + +collection-backlogged-crash-reports = + .label = Allow { -brand-short-name } to send backlogged crash reports on your behalf + .accesskey = c +collection-backlogged-crash-reports-link = Learn more + +## Privacy Section - Security +## +## It is important that wording follows the guidelines outlined on this page: +## https://developers.google.com/safe-browsing/developers_guide_v2#AcceptableUsage + +security-header = Security + +security-browsing-protection = Deceptive Content and Dangerous Software Protection + +security-enable-safe-browsing = + .label = Block dangerous and deceptive content + .accesskey = B +security-enable-safe-browsing-link = Learn more + +security-block-downloads = + .label = Block dangerous downloads + .accesskey = d + +security-block-uncommon-software = + .label = Warn you about unwanted and uncommon software + .accesskey = c + +## Privacy Section - Certificates + +certs-header = Certificates + +certs-personal-label = When a server requests your personal certificate + +certs-select-auto-option = + .label = Select one automatically + .accesskey = S + +certs-select-ask-option = + .label = Ask you every time + .accesskey = A + +certs-enable-ocsp = + .label = Query OCSP responder servers to confirm the current validity of certificates + .accesskey = Q + +certs-view = + .label = View Certificates… + .accesskey = C + +certs-devices = + .label = Security Devices… + .accesskey = D + +space-alert-learn-more-button = + .label = Learn More + .accesskey = L + +space-alert-over-5gb-pref-button = + .label = + { PLATFORM() -> + [windows] Open Options + *[other] Open Preferences + } + .accesskey = + { PLATFORM() -> + [windows] O + *[other] O + } + +space-alert-over-5gb-message = + { PLATFORM() -> + [windows] { -brand-short-name } is running out of disk space. Website contents may not display properly. You can clear stored data in Options > Privacy & Security > Cookies and Site Data. + *[other] { -brand-short-name } is running out of disk space. Website contents may not display properly. You can clear stored data in Preferences > Privacy & Security > Cookies and Site Data. + } + +space-alert-under-5gb-ok-button = + .label = OK, Got it + .accesskey = K + +space-alert-under-5gb-message = { -brand-short-name } is running out of disk space. Website contents may not display properly. Visit “Learn More” to optimize your disk usage for better browsing experience. + +## The following strings are used in the Download section of settings +desktop-folder-name = Desktop +downloads-folder-name = Downloads +choose-download-folder-title = Choose Download Folder: + +# Variables: +# $service-name (String) - Name of a cloud storage provider like Dropbox, Google Drive, etc... +save-files-to-cloud-storage = + .label = Save files to { $service-name } + + +## browser/branding/official/locales/en-US/brand.ftl + +-brand-short-name = Firefox +-vendor-short-name = Mozilla + +## browser/locales/en-US/browser/branding/sync-brand.ftl + +-fxaccount-brand-name = Firefox Account + +## browser/locales/en-US/browser/branding/sync-brand.ftl + +-sync-brand-short-name = Sync diff --git a/third_party/rust/fluent-bundle/benches/simple.ftl b/third_party/rust/fluent-bundle/benches/simple.ftl new file mode 100644 index 000000000000..223e050a6ec1 --- /dev/null +++ b/third_party/rust/fluent-bundle/benches/simple.ftl @@ -0,0 +1,102 @@ +# Artificial testcase with 100 simple Fluent Messages + +key0 = Value 0 +key1 = Value 1 +key2 = Value 2 +key3 = Value 3 +key4 = Value 4 +key5 = Value 5 +key6 = Value 6 +key7 = Value 7 +key8 = Value 8 +key9 = Value 9 +key10 = Value 10 +key11 = Value 11 +key12 = Value 12 +key13 = Value 13 +key14 = Value 14 +key15 = Value 15 +key16 = Value 16 +key17 = Value 17 +key18 = Value 18 +key19 = Value 19 +key20 = Value 20 +key21 = Value 21 +key22 = Value 22 +key23 = Value 23 +key24 = Value 24 +key25 = Value 25 +key26 = Value 26 +key27 = Value 27 +key28 = Value 28 +key29 = Value 29 +key30 = Value 30 +key31 = Value 31 +key32 = Value 32 +key33 = Value 33 +key34 = Value 34 +key35 = Value 35 +key36 = Value 36 +key37 = Value 37 +key38 = Value 38 +key39 = Value 39 +key40 = Value 40 +key41 = Value 41 +key42 = Value 42 +key43 = Value 43 +key44 = Value 44 +key45 = Value 45 +key46 = Value 46 +key47 = Value 47 +key48 = Value 48 +key49 = Value 49 +key50 = Value 50 +key51 = Value 51 +key52 = Value 52 +key53 = Value 53 +key54 = Value 54 +key55 = Value 55 +key56 = Value 56 +key57 = Value 57 +key58 = Value 58 +key59 = Value 59 +key60 = Value 60 +key61 = Value 61 +key62 = Value 62 +key63 = Value 63 +key64 = Value 64 +key65 = Value 65 +key66 = Value 66 +key67 = Value 67 +key68 = Value 68 +key69 = Value 69 +key70 = Value 70 +key71 = Value 71 +key72 = Value 72 +key73 = Value 73 +key74 = Value 74 +key75 = Value 75 +key76 = Value 76 +key77 = Value 77 +key78 = Value 78 +key79 = Value 79 +key80 = Value 80 +key81 = Value 81 +key82 = Value 82 +key83 = Value 83 +key84 = Value 84 +key85 = Value 85 +key86 = Value 86 +key87 = Value 87 +key88 = Value 88 +key89 = Value 89 +key90 = Value 90 +key91 = Value 91 +key92 = Value 92 +key93 = Value 93 +key94 = Value 94 +key95 = Value 95 +key96 = Value 96 +key97 = Value 97 +key98 = Value 98 +key99 = Value 99 diff --git a/third_party/rust/fluent-bundle/benches/unescape.ftl b/third_party/rust/fluent-bundle/benches/unescape.ftl new file mode 100644 index 000000000000..7ea33f601498 --- /dev/null +++ b/third_party/rust/fluent-bundle/benches/unescape.ftl @@ -0,0 +1,9 @@ +face-with-tears-of-joy = 😂 +tetragram-for-centre = 𝌆 + +surrogates-in-text = \uD83D\uDE02 +surrogates-in-string = {"\uD83D\uDE02"} +surrogates-in-adjacent-strings = {"\uD83D"}{"\uDE02"} + +emoji-in-text = A face 😂 with tears of joy. +emoji-in-string = {"A face 😂 with tears of joy."} diff --git a/third_party/rust/fluent-bundle/examples/custom_formatter.rs b/third_party/rust/fluent-bundle/examples/custom_formatter.rs new file mode 100644 index 000000000000..67c09b0e64f7 --- /dev/null +++ b/third_party/rust/fluent-bundle/examples/custom_formatter.rs @@ -0,0 +1,145 @@ +// This is an example of an application which uses a custom formatter +// to format selected types of values. +// +// This allows users to plug their own number formatter to Fluent. +use unic_langid::LanguageIdentifier; + +use fluent_bundle::memoizer::MemoizerKind; +use fluent_bundle::types::{FluentNumber, FluentNumberOptions}; +use fluent_bundle::{FluentArgs, FluentBundle, FluentResource, FluentValue}; + +fn custom_formatter(num: &FluentValue, _intls: &M) -> Option { + match num { + FluentValue::Number(n) => Some(format!("CUSTOM({})", n.value).into()), + _ => None, + } +} + +fn main() { + // 1. Bootstrap a FluentBundle with a number of messages which use + // number formatting in different forms. + let ftl_string = String::from( + " +key-implicit = Here is an implicitly encoded number: { 5 }. +key-explicit = Here is an explicitly encoded number: { NUMBER(5) }. +key-var-implicit = Here is an implicitly encoded variable: { $num }. +key-var-explicit = Here is an explicitly encoded variable: { NUMBER($num) }. +key-var-with-arg = Here is a variable formatted with an argument { NUMBER($num, minimumFractionDigits: 5) }. + ", + ); + let res = FluentResource::try_new(ftl_string).expect("Could not parse an FTL string."); + + let lang: LanguageIdentifier = "en".parse().unwrap(); + let mut bundle = FluentBundle::new(&[lang]); + bundle + .add_resource(res) + .expect("Failed to add FTL resources to the bundle."); + bundle + .add_function("NUMBER", |positional, named| { + match positional.get(0) { + Some(FluentValue::Number(n)) => { + let mut num = n.clone(); + // This allows us to merge the arguments provided + // as arguments to the function into the new FluentNumber. + num.options.merge(named); + FluentValue::Number(num) + } + _ => FluentValue::None, + } + }) + .expect("Failed to add a function."); + bundle.set_use_isolating(false); + + let mut errors = vec![]; + + // 2. First, we're going to format the number using the implicit formatter. + // At the moment the number will be formatted in a very dummy way, since + // we do not have a locale aware number formatter available yet. + let msg = bundle + .get_message("key-implicit") + .expect("Message doesn't exist."); + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, None, &mut errors); + assert_eq!(value, "Here is an implicitly encoded number: 5."); + println!("{}", value); + + // 3. Next, we're going to plug our custom formatter. + bundle.set_formatter(Some(custom_formatter)); + + // 4. Now, when you attempt to format a number, the custom formatter + // will be used instead of the default one. + let msg = bundle + .get_message("key-implicit") + .expect("Message doesn't exist."); + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, None, &mut errors); + assert_eq!(value, "Here is an implicitly encoded number: CUSTOM(5)."); + println!("{}", value); + + // 5. The same custom formatter will be used for explicitly formatter numbers, + // and variables of type number. + let msg = bundle + .get_message("key-explicit") + .expect("Message doesn't exist."); + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, None, &mut errors); + assert_eq!(value, "Here is an explicitly encoded number: CUSTOM(5)."); + println!("{}", value); + + let msg = bundle + .get_message("key-var-implicit") + .expect("Message doesn't exist."); + let pattern = msg.value.expect("Message has no value."); + let mut args = FluentArgs::new(); + args.insert("num", FluentValue::from(-15)); + let value = bundle.format_pattern(&pattern, Some(&args), &mut errors); + assert_eq!( + value, + "Here is an implicitly encoded variable: CUSTOM(-15)." + ); + println!("{}", value); + + let msg = bundle + .get_message("key-var-explicit") + .expect("Message doesn't exist."); + let pattern = msg.value.expect("Message has no value."); + let mut args = FluentArgs::new(); + args.insert("num", FluentValue::from(-15)); + let value = bundle.format_pattern(&pattern, Some(&args), &mut errors); + assert_eq!( + value, + "Here is an explicitly encoded variable: CUSTOM(-15)." + ); + println!("{}", value); + + // 6. The merging operation on FluentNumber options allows the + // options provided from the localizer to be merged into the + // default ones and ones provided by the developer. + let msg = bundle + .get_message("key-var-explicit") + .expect("Message doesn't exist."); + let pattern = msg.value.expect("Message has no value."); + let mut args = FluentArgs::new(); + let num = FluentNumber::new( + 25.2, + FluentNumberOptions { + maximum_fraction_digits: Some(8), + minimum_fraction_digits: Some(1), + ..Default::default() + }, + ); + args.insert("num", num.into()); + let value = bundle.format_pattern(&pattern, Some(&args), &mut errors); + + // Notice, that since we specificed minimum and maximum fraction digits options + // to be 1 and 8 when construction the argument, and then the minimum fraction + // digits option has been overridden in the localization the formatter + // will received options: + // - minimum_fraction_digits: Some(5) + // - maximum_fraction_digits: Some(8) + assert_eq!( + value, + "Here is an explicitly encoded variable: CUSTOM(25.2)." + ); + println!("{}", value); +} diff --git a/third_party/rust/fluent-bundle/examples/custom_type.rs b/third_party/rust/fluent-bundle/examples/custom_type.rs new file mode 100644 index 000000000000..0b5a12c7e875 --- /dev/null +++ b/third_party/rust/fluent-bundle/examples/custom_type.rs @@ -0,0 +1,190 @@ +// This is an example of an application which adds a custom type of value, +// and a function to format it. +// +// In this example we're going to add a new type - DateTime. +// +// We're also going to add a built-in function DATETIME to produce that type +// out of a number argument (epoch). +// +// Lastly, we'll also create a new formatter which will be memoizable. +// +// The type and its options are modelled after ECMA402 Intl.DateTimeFormat. +use intl_memoizer::Memoizable; +use unic_langid::LanguageIdentifier; + +use fluent_bundle::types::FluentType; +use fluent_bundle::{FluentArgs, FluentBundle, FluentResource, FluentValue}; + +// First we're going to define what options our new type is going to accept. +// For the sake of the example, we're only going to allow two options: +// - dateStyle +// - timeStyle +// +// with an enum of allowed values. +#[derive(Debug, PartialEq, Eq, Clone, Hash)] +enum DateTimeStyleValue { + Full, + Long, + Medium, + Short, + None, +} + +impl std::default::Default for DateTimeStyleValue { + fn default() -> Self { + Self::None + } +} + +// This is just a helper to make it easier to convert +// a value provided to FluentArgs into an option value. +impl<'l> From<&FluentValue<'l>> for DateTimeStyleValue { + fn from(input: &FluentValue) -> Self { + if let FluentValue::String(s) = input { + match s.as_ref() { + "full" => Self::Full, + "long" => Self::Long, + "medium" => Self::Medium, + "short" => Self::Short, + _ => Self::None, + } + } else { + Self::None + } + } +} + +#[derive(Debug, PartialEq, Eq, Default, Clone, Hash)] +struct DateTimeOptions { + pub date_style: DateTimeStyleValue, + pub time_style: DateTimeStyleValue, +} + +impl DateTimeOptions { + // The merge function is going to be used by the Fluent Function + // to merge localizer provided options into defaults of values + // provided by the developer. + // + // If you want to limit which options the localizer can override, + // here's the right place to do it. + pub fn merge(&mut self, input: &FluentArgs) { + for (key, value) in input { + match *key { + "dateStyle" => self.date_style = value.into(), + "timeStyle" => self.time_style = value.into(), + _ => {} + } + } + } +} + +impl<'l> From<&FluentArgs<'l>> for DateTimeOptions { + fn from(input: &FluentArgs) -> Self { + let mut opts = Self::default(); + opts.merge(input); + opts + } +} + +// Our new custom type will store a value as an epoch number, +// and the options. + +#[derive(Debug, PartialEq, Clone)] +struct DateTime { + epoch: usize, + options: DateTimeOptions, +} + +impl DateTime { + pub fn new(epoch: usize, options: DateTimeOptions) -> Self { + Self { epoch, options } + } +} + +impl FluentType for DateTime { + fn duplicate(&self) -> Box { + Box::new(DateTime::new(self.epoch, DateTimeOptions::default())) + } + fn as_string(&self, intls: &intl_memoizer::IntlLangMemoizer) -> std::borrow::Cow<'static, str> { + intls + .with_try_get::((self.options.clone(),), |dtf| { + dtf.format(self.epoch).into() + }) + .expect("Failed to format a date.") + } + fn as_string_threadsafe( + &self, + _: &intl_memoizer::concurrent::IntlLangMemoizer, + ) -> std::borrow::Cow<'static, str> { + format!("2020-01-20 {}:00", self.epoch).into() + } +} + +/// Formatter + +struct DateTimeFormatter { + lang: LanguageIdentifier, + options: DateTimeOptions, +} + +impl DateTimeFormatter { + pub fn new(lang: LanguageIdentifier, options: DateTimeOptions) -> Result { + Ok(Self { lang, options }) + } + + pub fn format(&self, epoch: usize) -> String { + format!( + "My Custom Formatted Date from epoch: {}, in locale: {}, using options: {:#?}", + epoch, self.lang, self.options + ) + } +} + +impl Memoizable for DateTimeFormatter { + type Args = (DateTimeOptions,); + type Error = (); + fn construct(lang: LanguageIdentifier, args: Self::Args) -> Result { + Self::new(lang, args.0) + } +} + +fn main() { + // 1. Bootstrap a FluentBundle with a number of messages which use + // number formatting in different forms. + let ftl_string = String::from( + r#" +key-date = Today is { DATETIME($epoch, dateStyle: "long", timeStyle: "short") } + "#, + ); + let res = FluentResource::try_new(ftl_string).expect("Could not parse an FTL string."); + + let lang: LanguageIdentifier = "en".parse().unwrap(); + let mut bundle = FluentBundle::new(&[lang]); + bundle + .add_resource(res) + .expect("Failed to add FTL resources to the bundle."); + + bundle + .add_function("DATETIME", |positional, named| match positional.get(0) { + Some(FluentValue::Number(n)) => { + let epoch = n.value as usize; + let options = named.into(); + FluentValue::Custom(Box::new(DateTime::new(epoch, options))) + } + _ => FluentValue::None, + }) + .expect("Failed to add a function."); + bundle.set_use_isolating(false); + + let msg = bundle + .get_message("key-date") + .expect("Failed to retrieve the message."); + let pattern = msg.value.expect("Message has no value."); + let mut errors = vec![]; + + let mut args = FluentArgs::new(); + let epoch: u64 = 1580127760093; + args.insert("epoch", epoch.into()); + let value = bundle.format_pattern(pattern, Some(&args), &mut errors); + println!("{}", value); +} diff --git a/third_party/rust/fluent-bundle/examples/external_arguments.rs b/third_party/rust/fluent-bundle/examples/external_arguments.rs new file mode 100644 index 000000000000..438a53fafe9f --- /dev/null +++ b/third_party/rust/fluent-bundle/examples/external_arguments.rs @@ -0,0 +1,50 @@ +use fluent_bundle::{FluentArgs, FluentBundle, FluentResource, FluentValue}; +use unic_langid::langid; + +fn main() { + let ftl_string = String::from( + " +hello-world = Hello { $name } +ref = The previous message says { hello-world } +unread-emails = + { $emailCount -> + [one] You have { $emailCount } unread email + *[other] You have { $emailCount } unread emails + } + ", + ); + let res = FluentResource::try_new(ftl_string).expect("Could not parse an FTL string."); + let langid_en = langid!("en"); + let mut bundle = FluentBundle::new(&[langid_en]); + bundle + .add_resource(res) + .expect("Failed to add FTL resources to the bundle."); + + let mut args = FluentArgs::new(); + args.insert("name", FluentValue::from("John")); + + let msg = bundle + .get_message("hello-world") + .expect("Message doesn't exist."); + let mut errors = vec![]; + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, Some(&args), &mut errors); + println!("{}", value); + + let msg = bundle.get_message("ref").expect("Message doesn't exist."); + let mut errors = vec![]; + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, Some(&args), &mut errors); + println!("{}", value); + + let mut args = FluentArgs::new(); + args.insert("emailCount", 1.into()); + + let msg = bundle + .get_message("unread-emails") + .expect("Message doesn't exist."); + let mut errors = vec![]; + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, Some(&args), &mut errors); + println!("{}", value); +} diff --git a/third_party/rust/fluent-bundle/examples/functions.rs b/third_party/rust/fluent-bundle/examples/functions.rs new file mode 100644 index 000000000000..f386d07ab674 --- /dev/null +++ b/third_party/rust/fluent-bundle/examples/functions.rs @@ -0,0 +1,82 @@ +use fluent_bundle::{FluentBundle, FluentResource, FluentValue}; +use unic_langid::langid; + +fn main() { + // We define the resources here so that they outlive + // the bundle. + let ftl_string1 = String::from("hello-world = Hey there! { HELLO() }"); + let ftl_string2 = String::from("meaning-of-life = { MEANING_OF_LIFE(42) }"); + let ftl_string3 = String::from("all-your-base = { BASE_OWNERSHIP(hello, ownership: \"us\") }"); + let res1 = FluentResource::try_new(ftl_string1).expect("Could not parse an FTL string."); + let res2 = FluentResource::try_new(ftl_string2).expect("Could not parse an FTL string."); + let res3 = FluentResource::try_new(ftl_string3).expect("Could not parse an FTL string."); + + let langid_en_us = langid!("en-US"); + let mut bundle = FluentBundle::new(&[langid_en_us]); + + // Test for a simple function that returns a string + bundle + .add_function("HELLO", |_args, _named_args| { + return "I'm a function!".into(); + }) + .expect("Failed to add a function to the bundle."); + + // Test for a function that accepts unnamed positional arguments + bundle + .add_function("MEANING_OF_LIFE", |args, _named_args| { + if let Some(arg0) = args.get(0) { + if *arg0 == 42.into() { + return "The answer to life, the universe, and everything".into(); + } + } + + FluentValue::None + }) + .expect("Failed to add a function to the bundle."); + + // Test for a function that accepts named arguments + bundle + .add_function("BASE_OWNERSHIP", |_args, named_args| { + return match named_args.get("ownership") { + Some(FluentValue::String(ref string)) => { + format!("All your base belong to {}", string).into() + } + _ => FluentValue::None, + }; + }) + .expect("Failed to add a function to the bundle."); + + bundle + .add_resource(res1) + .expect("Failed to add FTL resources to the bundle."); + bundle + .add_resource(res2) + .expect("Failed to add FTL resources to the bundle."); + bundle + .add_resource(res3) + .expect("Failed to add FTL resources to the bundle."); + + let msg = bundle + .get_message("hello-world") + .expect("Message doesn't exist."); + let mut errors = vec![]; + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, None, &mut errors); + assert_eq!(&value, "Hey there! \u{2068}I'm a function!\u{2069}"); + + let msg = bundle + .get_message("meaning-of-life") + .expect("Message doesn't exist."); + let mut errors = vec![]; + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, None, &mut errors); + assert_eq!(&value, "The answer to life, the universe, and everything"); + + let msg = bundle + .get_message("all-your-base") + .expect("Message doesn't exist."); + let mut errors = vec![]; + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, None, &mut errors); + assert_eq!(&value, "All your base belong to us"); +} diff --git a/third_party/rust/fluent-bundle/examples/hello.rs b/third_party/rust/fluent-bundle/examples/hello.rs new file mode 100644 index 000000000000..6e33f6934727 --- /dev/null +++ b/third_party/rust/fluent-bundle/examples/hello.rs @@ -0,0 +1,18 @@ +use fluent_bundle::{FluentBundle, FluentResource}; + +fn main() { + let ftl_string = String::from("hello-world = Hello, world!"); + let res = FluentResource::try_new(ftl_string).expect("Could not parse an FTL string."); + let mut bundle = FluentBundle::default(); + bundle + .add_resource(&res) + .expect("Failed to add FTL resources to the bundle."); + + let msg = bundle + .get_message("hello-world") + .expect("Message doesn't exist."); + let mut errors = vec![]; + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, None, &mut errors); + assert_eq!(&value, "Hello, world!"); +} diff --git a/third_party/rust/fluent-bundle/examples/message_reference.rs b/third_party/rust/fluent-bundle/examples/message_reference.rs new file mode 100644 index 000000000000..dda9b67c0719 --- /dev/null +++ b/third_party/rust/fluent-bundle/examples/message_reference.rs @@ -0,0 +1,33 @@ +use fluent_bundle::{FluentBundle, FluentResource}; + +fn main() { + let ftl_string = String::from( + " +foo = Foo +foobar = { foo } Bar +bazbar = { baz } Bar + ", + ); + let res = FluentResource::try_new(ftl_string).expect("Could not parse an FTL string."); + + let mut bundle = FluentBundle::default(); + bundle + .add_resource(res) + .expect("Failed to add FTL resources to the bundle."); + + let msg = bundle + .get_message("foobar") + .expect("Message doesn't exist."); + let mut errors = vec![]; + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, None, &mut errors); + println!("{}", value); + + let msg = bundle + .get_message("bazbar") + .expect("Message doesn't exist."); + let mut errors = vec![]; + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, None, &mut errors); + println!("{}", value); +} diff --git a/third_party/rust/fluent-bundle/examples/resources/en-US/simple.ftl b/third_party/rust/fluent-bundle/examples/resources/en-US/simple.ftl new file mode 100644 index 000000000000..99f0a6bb6f18 --- /dev/null +++ b/third_party/rust/fluent-bundle/examples/resources/en-US/simple.ftl @@ -0,0 +1,7 @@ +missing-arg-error = Error: Please provide a number as argument. +input-parse-error = Error: Could not parse input `{ $input }`. Reason: { $reason } +response-msg = + { $value -> + [one] "{ $input }" has one Collatz step. + *[other] "{ $input }" has { $value } Collatz steps. + } diff --git a/third_party/rust/fluent-bundle/examples/resources/fr/simple.ftl b/third_party/rust/fluent-bundle/examples/resources/fr/simple.ftl new file mode 100644 index 000000000000..6adcfd3ea619 --- /dev/null +++ b/third_party/rust/fluent-bundle/examples/resources/fr/simple.ftl @@ -0,0 +1,7 @@ +missing-arg-error = Erreur : veuillez saisir un nombre en paramètre. +input-parse-error = Erreur : impossible d'interpréter le paramètre `{ $input }`. Raison : { $reason } +response-msg = + { $value -> + [one] La suite de Syracuse du nombre "{ $input }" comporte une valeur. + *[other] La suite de Syracuse du nombre "{ $input }" comporte { $value } valeurs. + } diff --git a/third_party/rust/fluent-bundle/examples/resources/pl/simple.ftl b/third_party/rust/fluent-bundle/examples/resources/pl/simple.ftl new file mode 100644 index 000000000000..16173dd92e1d --- /dev/null +++ b/third_party/rust/fluent-bundle/examples/resources/pl/simple.ftl @@ -0,0 +1,8 @@ +missing-arg-error = Błąd: Proszę wprowadzić liczbę jako argument. +input-parse-error = Błąd: Nie udało się sparsować `{ $input }`. Powód: { $reason } +response-msg = + { $value -> + [one] "{ $input }" ma jeden krok Collatza. + [few] "{ $input }" ma { $value } kroki Collatza. + *[many] "{ $input }" ma { $value } kroków Collatza. + } diff --git a/third_party/rust/fluent-bundle/examples/selector.rs b/third_party/rust/fluent-bundle/examples/selector.rs new file mode 100644 index 000000000000..3cc351864386 --- /dev/null +++ b/third_party/rust/fluent-bundle/examples/selector.rs @@ -0,0 +1,41 @@ +use fluent_bundle::{FluentArgs, FluentBundle, FluentResource, FluentValue}; + +fn main() { + let ftl_string = String::from( + " +hello-world = Hello { $missing -> + *[one] World + [two] Moon + } + +hello-world2 = Hello { $name -> + *[world] World + [moon] Moon + } + ", + ); + let res = FluentResource::try_new(ftl_string).expect("Could not parse an FTL string."); + let mut bundle = FluentBundle::default(); + bundle + .add_resource(res) + .expect("Failed to add FTL resources to the bundle."); + + let msg = bundle + .get_message("hello-world") + .expect("Message doesn't exist."); + let mut errors = vec![]; + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, None, &mut errors); + println!("{}", value); + + let mut args = FluentArgs::new(); + args.insert("name", FluentValue::from("moon")); + + let msg = bundle + .get_message("hello-world2") + .expect("Message doesn't exist."); + let mut errors = vec![]; + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, Some(&args), &mut errors); + println!("{}", value); +} diff --git a/third_party/rust/fluent-bundle/examples/simple-app.rs b/third_party/rust/fluent-bundle/examples/simple-app.rs new file mode 100644 index 000000000000..07667be654b9 --- /dev/null +++ b/third_party/rust/fluent-bundle/examples/simple-app.rs @@ -0,0 +1,179 @@ +//! This is an example of a simple application +//! which calculates the Collatz conjecture. +//! +//! The function itself is trivial on purpose, +//! so that we can focus on understanding how +//! the application can be made localizable +//! via Fluent. +//! +//! To try the app launch `cargo run --example simple-app NUM (LOCALES)` +//! +//! NUM is a number to be calculated, and LOCALES is an optional +//! parameter with a comma-separated list of locales requested by the user. +//! +//! Example: +//! +//! cargo run --example simple-app 123 de,pl +//! +//! If the second argument is omitted, `en-US` locale is used as the +//! default one. +use fluent_bundle::{FluentArgs, FluentBundle, FluentResource, FluentValue}; +use fluent_langneg::{negotiate_languages, NegotiationStrategy}; +use std::env; +use std::fs; +use std::fs::File; +use std::io; +use std::io::prelude::*; +use std::path::Path; +use std::str::FromStr; +use unic_langid::{langid, LanguageIdentifier}; + +/// We need a generic file read helper function to +/// read the localization resource file. +/// +/// The resource files are stored in +/// `./examples/resources/{locale}` directory. +fn read_file(path: &Path) -> Result { + let mut f = File::open(path)?; + let mut s = String::new(); + f.read_to_string(&mut s)?; + Ok(s) +} + +/// This helper function allows us to read the list +/// of available locales by reading the list of +/// directories in `./examples/resources`. +/// +/// It is expected that every directory inside it +/// has a name that is a valid BCP47 language tag. +fn get_available_locales() -> Result, io::Error> { + let mut locales = vec![]; + + let mut dir = env::current_dir()?; + if dir.to_string_lossy().ends_with("fluent-rs") { + dir.push("fluent-bundle"); + } + dir.push("examples"); + dir.push("resources"); + let res_dir = fs::read_dir(dir)?; + for entry in res_dir { + if let Ok(entry) = entry { + let path = entry.path(); + if path.is_dir() { + if let Some(name) = path.file_name() { + if let Some(name) = name.to_str() { + let langid = name.parse().expect("Parsing failed."); + locales.push(langid); + } + } + } + } + } + return Ok(locales); +} + +static L10N_RESOURCES: &[&str] = &["simple.ftl"]; + +fn main() { + // 1. Get the command line arguments. + let args: Vec = env::args().collect(); + + // 3. If the argument length is more than 1, + // take the second argument as a comma-separated + // list of requested locales. + let requested = args.get(2).map_or(vec![], |arg| { + arg.split(",") + .map(|s| -> LanguageIdentifier { s.parse().expect("Parsing locale failed.") }) + .collect() + }); + + // 4. Negotiate it against the available ones + let default_locale = langid!("en-US"); + let available = get_available_locales().expect("Retrieving available locales failed."); + let resolved_locales = negotiate_languages( + &requested, + &available, + Some(&default_locale), + NegotiationStrategy::Filtering, + ); + let current_locale = resolved_locales + .get(0) + .expect("At least one locale should match."); + + // 5. Create a new Fluent FluentBundle using the + // resolved locales. + let mut bundle = FluentBundle::new(resolved_locales.clone()); + + // 6. Load the localization resource + for path in L10N_RESOURCES { + let mut full_path = env::current_dir().expect("Failed to retireve current dir."); + if full_path.to_string_lossy().ends_with("fluent-rs") { + full_path.push("fluent-bundle"); + } + full_path.push("examples"); + full_path.push("resources"); + full_path.push(current_locale.to_string()); + full_path.push(path); + let source = read_file(&full_path).expect("Failed to read file."); + let resource = FluentResource::try_new(source).expect("Could not parse an FTL string."); + bundle + .add_resource(resource) + .expect("Failed to add FTL resources to the bundle."); + } + + // 7. Check if the input is provided. + match args.get(1) { + Some(input) => { + // 7.1. Cast it to a number. + match isize::from_str(&input) { + Ok(i) => { + // 7.2. Construct a map of arguments + // to format the message. + let mut args = FluentArgs::new(); + args.insert("input", FluentValue::from(i)); + args.insert("value", FluentValue::from(collatz(i))); + // 7.3. Format the message. + let mut errors = vec![]; + let msg = bundle + .get_message("response-msg") + .expect("Message doesn't exist."); + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, Some(&args), &mut errors); + println!("{}", value); + } + Err(err) => { + let mut args = FluentArgs::new(); + args.insert("input", FluentValue::from(input.as_str())); + args.insert("reason", FluentValue::from(err.to_string())); + let mut errors = vec![]; + let msg = bundle + .get_message("input-parse-error") + .expect("Message doesn't exist."); + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, Some(&args), &mut errors); + println!("{}", value); + } + } + } + None => { + let mut errors = vec![]; + let msg = bundle + .get_message("missing-arg-error") + .expect("Message doesn't exist."); + let pattern = msg.value.expect("Message has no value."); + let value = bundle.format_pattern(&pattern, None, &mut errors); + println!("{}", value); + } + } +} + +/// Collatz conjecture calculating function. +fn collatz(n: isize) -> isize { + match n { + 1 => 0, + _ => match n % 2 { + 0 => 1 + collatz(n / 2), + _ => 1 + collatz(n * 3 + 1), + }, + } +} diff --git a/third_party/rust/fluent-bundle/src/types/mod.rs b/third_party/rust/fluent-bundle/src/types/mod.rs index a51006098db2..42447e7e4b18 100644 --- a/third_party/rust/fluent-bundle/src/types/mod.rs +++ b/third_party/rust/fluent-bundle/src/types/mod.rs @@ -107,7 +107,7 @@ impl<'source> From<&ast::InlineExpression<'source>> for DisplayableNode<'source> } pub trait FluentType: fmt::Debug + AnyEq + 'static { - fn duplicate(&self) -> Box; + fn duplicate(&self) -> Box; fn as_string(&self, intls: &intl_memoizer::IntlLangMemoizer) -> Cow<'static, str>; fn as_string_threadsafe( &self, @@ -115,7 +115,7 @@ pub trait FluentType: fmt::Debug + AnyEq + 'static { ) -> Cow<'static, str>; } -impl PartialEq for dyn FluentType + Send { +impl PartialEq for dyn FluentType { fn eq(&self, other: &Self) -> bool { self.equals(other.as_any()) } @@ -155,7 +155,7 @@ impl AnyEq for T { pub enum FluentValue<'source> { String(Cow<'source, str>), Number(FluentNumber), - Custom(Box), + Custom(Box), Error(DisplayableNode<'source>), None, } @@ -176,7 +176,7 @@ impl<'s> Clone for FluentValue<'s> { FluentValue::String(s) => FluentValue::String(s.clone()), FluentValue::Number(s) => FluentValue::Number(s.clone()), FluentValue::Custom(s) => { - let new_value: Box = s.duplicate(); + let new_value: Box = s.duplicate(); FluentValue::Custom(new_value) } FluentValue::Error(e) => FluentValue::Error(e.clone()), diff --git a/third_party/rust/fluent-bundle/src/types/number.rs b/third_party/rust/fluent-bundle/src/types/number.rs index cf00deceee75..4ec2a0bf97bc 100644 --- a/third_party/rust/fluent-bundle/src/types/number.rs +++ b/third_party/rust/fluent-bundle/src/types/number.rs @@ -222,7 +222,7 @@ impl From<&FluentNumber> for PluralOperands { .expect("Failed to generate operands out of FluentNumber"); if let Some(mfd) = input.options.minimum_fraction_digits { if mfd > operands.v { - operands.f *= 10_u64.pow(mfd as u32 - operands.v as u32); + operands.f *= 10_usize.pow(mfd as u32 - operands.v as u32); operands.v = mfd; } } diff --git a/third_party/rust/fluent-bundle/tests/bundle.rs b/third_party/rust/fluent-bundle/tests/bundle.rs new file mode 100644 index 000000000000..eb0cee10540f --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/bundle.rs @@ -0,0 +1,37 @@ +use fluent_bundle::{FluentBundle, FluentResource}; +use unic_langid::LanguageIdentifier; + +#[test] +fn add_resource_override() { + let res = FluentResource::try_new("key = Value".to_string()).unwrap(); + let res2 = FluentResource::try_new("key = Value 2".to_string()).unwrap(); + + let en_us: LanguageIdentifier = "en-US" + .parse() + .expect("Failed to parse a language identifier"); + let mut bundle = FluentBundle::<&FluentResource>::new(&[en_us]); + + bundle.add_resource(&res).expect("Failed to add a resource"); + + assert!(bundle.add_resource(&res2).is_err()); + + let mut errors = vec![]; + + let value = bundle + .get_message("key") + .expect("Failed to retireve a message") + .value + .expect("Failed to retireve a value of a message"); + assert_eq!(bundle.format_pattern(value, None, &mut errors), "Value"); + + bundle.add_resource_overriding(&res2); + + let value = bundle + .get_message("key") + .expect("Failed to retireve a message") + .value + .expect("Failed to retireve a value of a message"); + assert_eq!(bundle.format_pattern(value, None, &mut errors), "Value 2"); + + assert!(errors.is_empty()); +} diff --git a/third_party/rust/fluent-bundle/tests/custom_types.rs b/third_party/rust/fluent-bundle/tests/custom_types.rs new file mode 100644 index 000000000000..1fddbb641dc2 --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/custom_types.rs @@ -0,0 +1,230 @@ +use fluent_bundle::memoizer::MemoizerKind; +use fluent_bundle::types::FluentType; +use fluent_bundle::FluentArgs; +use fluent_bundle::FluentBundle; +use fluent_bundle::FluentResource; +use fluent_bundle::FluentValue; +use unic_langid::langid; + +#[test] +fn fluent_custom_type() { + #[derive(Debug, PartialEq)] + struct DateTime { + epoch: usize, + }; + + impl DateTime { + pub fn new(epoch: usize) -> Self { + Self { epoch } + } + } + + impl FluentType for DateTime { + fn duplicate(&self) -> Box { + Box::new(DateTime { epoch: self.epoch }) + } + fn as_string(&self, _: &intl_memoizer::IntlLangMemoizer) -> std::borrow::Cow<'static, str> { + format!("{}", self.epoch).into() + } + fn as_string_threadsafe( + &self, + _: &intl_memoizer::concurrent::IntlLangMemoizer, + ) -> std::borrow::Cow<'static, str> { + format!("{}", self.epoch).into() + } + } + + let dt = FluentValue::Custom(Box::new(DateTime::new(10))); + let dt2 = FluentValue::Custom(Box::new(DateTime::new(10))); + let dt3 = FluentValue::Custom(Box::new(DateTime::new(15))); + + let sv = FluentValue::from("foo"); + + assert_eq!(dt == dt2, true); + assert_eq!(dt == dt3, false); + assert_eq!(dt == sv, false); +} + +#[test] +fn fluent_date_time_builtin() { + #[derive(Debug, PartialEq, Clone)] + enum DateTimeStyleValue { + Full, + Long, + Medium, + Short, + None, + } + + impl std::default::Default for DateTimeStyleValue { + fn default() -> Self { + Self::None + } + } + + impl<'l> From<&FluentValue<'l>> for DateTimeStyleValue { + fn from(input: &FluentValue) -> Self { + if let FluentValue::String(s) = input { + match s.as_ref() { + "full" => Self::Full, + "long" => Self::Long, + "medium" => Self::Medium, + "short" => Self::Short, + _ => Self::None, + } + } else { + Self::None + } + } + } + + #[derive(Debug, PartialEq, Default, Clone)] + struct DateTimeOptions { + pub date_style: DateTimeStyleValue, + pub time_style: DateTimeStyleValue, + } + + impl DateTimeOptions { + pub fn merge(&mut self, input: &FluentArgs) { + for (key, value) in input { + match *key { + "dateStyle" => self.date_style = value.into(), + "timeStyle" => self.time_style = value.into(), + _ => {} + } + } + } + } + + impl<'l> From<&FluentArgs<'l>> for DateTimeOptions { + fn from(input: &FluentArgs) -> Self { + let mut opts = Self::default(); + opts.merge(input); + opts + } + } + + #[derive(Debug, PartialEq, Clone)] + struct DateTime { + epoch: usize, + options: DateTimeOptions, + }; + + impl DateTime { + pub fn new(epoch: usize, options: DateTimeOptions) -> Self { + Self { epoch, options } + } + } + + impl FluentType for DateTime { + fn duplicate(&self) -> Box { + Box::new(DateTime::new(self.epoch, DateTimeOptions::default())) + } + fn as_string(&self, _: &intl_memoizer::IntlLangMemoizer) -> std::borrow::Cow<'static, str> { + format!("2020-01-20 {}:00", self.epoch).into() + } + fn as_string_threadsafe( + &self, + _intls: &intl_memoizer::concurrent::IntlLangMemoizer, + ) -> std::borrow::Cow<'static, str> { + format!("2020-01-20 {}:00", self.epoch).into() + } + } + + let lang = langid!("en"); + let mut bundle = FluentBundle::new(&[lang]); + + let res = FluentResource::try_new( + r#" +key-explicit = Hello { DATETIME(12, dateStyle: "full") } World +key-ref = Hello { DATETIME($date, dateStyle: "full") } World + "# + .into(), + ) + .unwrap(); + bundle.add_resource(res).unwrap(); + bundle.set_use_isolating(false); + + bundle + .add_function("DATETIME", |positional, named| match positional.get(0) { + Some(FluentValue::Custom(custom)) => { + if let Some(that) = custom.as_ref().as_any().downcast_ref::() { + let mut dt = that.clone(); + dt.options.merge(named); + FluentValue::Custom(Box::new(dt)) + } else { + FluentValue::None + } + } + Some(FluentValue::Number(num)) => { + let num = num.value as usize; + FluentValue::Custom(Box::new(DateTime::new(num, named.into()))) + } + _ => FluentValue::None, + }) + .unwrap(); + + let mut errors = vec![]; + let mut args = FluentArgs::new(); + args.insert( + "date", + FluentValue::Custom(Box::new(DateTime::new(10, DateTimeOptions::default()))), + ); + + let msg = bundle.get_message("key-explicit").unwrap(); + let val = bundle.format_pattern(msg.value.unwrap(), Some(&args), &mut errors); + assert_eq!(val, "Hello 2020-01-20 12:00 World"); + + let msg = bundle.get_message("key-ref").unwrap(); + let val = bundle.format_pattern(msg.value.unwrap(), Some(&args), &mut errors); + assert_eq!(val, "Hello 2020-01-20 10:00 World"); +} + +#[test] +fn fluent_custom_number_format() { + fn custom_formatter(num: &FluentValue, _intls: &M) -> Option { + match num { + FluentValue::Number(_) => Some("CUSTOM".into()), + _ => None, + } + } + + let res = FluentResource::try_new( + r#" +key-num-implicit = Hello { 5.000 } World +key-num-explicit = Hello { NUMBER(5, minimumFractionDigits: 2) } World + "# + .into(), + ) + .unwrap(); + let mut bundle = FluentBundle::default(); + bundle.add_resource(res).unwrap(); + bundle.set_use_isolating(false); + + bundle + .add_function("NUMBER", |positional, named| match positional.get(0) { + Some(FluentValue::Number(n)) => { + let mut num = n.clone(); + num.options.merge(named); + FluentValue::Number(num) + } + _ => FluentValue::None, + }) + .unwrap(); + + let mut errors = vec![]; + + let msg = bundle.get_message("key-num-explicit").unwrap(); + let val = bundle.format_pattern(msg.value.unwrap(), None, &mut errors); + assert_eq!(val, "Hello 5.00 World"); + + let msg = bundle.get_message("key-num-implicit").unwrap(); + let val = bundle.format_pattern(msg.value.unwrap(), None, &mut errors); + assert_eq!(val, "Hello 5.000 World"); + + bundle.set_formatter(Some(custom_formatter)); + + let msg = bundle.get_message("key-num-implicit").unwrap(); + let val = bundle.format_pattern(msg.value.unwrap(), None, &mut errors); + assert_eq!(val, "Hello CUSTOM World"); +} diff --git a/third_party/rust/fluent-bundle/tests/fixtures/arguments.yaml b/third_party/rust/fluent-bundle/tests/fixtures/arguments.yaml new file mode 100644 index 000000000000..6ffa2679b506 --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/arguments.yaml @@ -0,0 +1,133 @@ +suites: + - + name: Variables + suites: + - + name: in values + resources: + - + source: |- + foo = Foo { $num } + bar = { foo } + baz = + .attr = Baz Attribute { $num } + qux = { "a" -> + *[a] Baz Variant A { $num } + } + tests: + - + name: can be used in the message value + asserts: + - + id: foo + args: + num: 3 + value: Foo 3 + - + name: can be used in the message value which is referenced + asserts: + - + id: bar + args: + num: 3 + value: Foo 3 + - + name: can be used in an attribute + asserts: + - + id: baz + attribute: attr + args: + num: 3 + value: Baz Attribute 3 + - + name: can be used in a variant + asserts: + - + id: qux + args: + num: 3 + value: Baz Variant A 3 + - + name: in selectors + resources: + - + source: |- + foo = { $num -> + *[3] Foo + } + tests: + - + name: can be used as a selector + asserts: + - + id: foo + args: + num: 3 + value: Foo + - + name: in function calls + resources: + - + source: |- + foo = { NUMBER($num) } + bundles: + - + functions: + - NUMBER + tests: + - + name: can be a positional argument + asserts: + - + id: foo + args: + num: 3 + value: 3 + - + name: simple errors + resources: + - + source: |- + foo = { $arg } + tests: + - + name: falls back to argument's name if it's missing + asserts: + - + id: foo + value: "{$arg}" + errors: + - + type: Reference + desc: "Unknown variable: $arg" + - + name: and strings + resources: + - + source: |- + foo = { $arg } + tests: + - + name: can be a string + asserts: + - + id: foo + args: + arg: Argument + value: Argument + - + name: and numbers + resources: + - + source: |- + foo = { $arg } + tests: + - + name: can be a number + asserts: + - + id: foo + args: + arg: 1 + value: 1 \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/fixtures/attributes.yaml b/third_party/rust/fluent-bundle/tests/fixtures/attributes.yaml new file mode 100644 index 000000000000..af836e758c9b --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/attributes.yaml @@ -0,0 +1,178 @@ +suites: + - + name: Attributes + suites: + - + name: missing + resources: + - + source: |- + foo = Foo + bar = Bar + .attr = Bar Attribute + baz = { foo } Baz + qux = { foo } Qux + .attr = Qux Attribute + ref-foo = { foo.missing } + ref-bar = { bar.missing } + ref-baz = { baz.missing } + ref-qux = { qux.missing } + tests: + - + name: falls back to id.attr for entities with string values and no attributes + asserts: + - + id: ref-foo + value: "{foo.missing}" + errors: + - + type: Reference + desc: "Unknown attribute: foo.missing" + - + name: falls back to id.attr for entities with string values and other attributes + asserts: + - + id: ref-bar + value: "{bar.missing}" + errors: + - + type: Reference + desc: "Unknown attribute: bar.missing" + - + name: falls back to id.attr for entities with pattern values and no attributes + asserts: + - + id: ref-baz + value: "{baz.missing}" + errors: + - + type: Reference + desc: "Unknown attribute: baz.missing" + - + name: falls back to id.attr for entities with pattern values and other attributes + asserts: + - + id: ref-qux + value: "{qux.missing}" + errors: + - + type: Reference + desc: "Unknown attribute: qux.missing" + - + name: with string values + resources: + - + source: |- + foo = Foo + .attr = Foo Attribute + bar = { foo } Bar + .attr = Bar Attribute + ref-foo = { foo.attr } + ref-bar = { bar.attr } + tests: + - + name: can be referenced for entities with string values + asserts: + - + id: ref-foo + value: Foo Attribute + - + name: can be formatted directly for entities with string values + asserts: + - + id: foo + attribute: attr + value: Foo Attribute + - + name: can be referenced for entities with pattern values + asserts: + - + id: ref-bar + value: Bar Attribute + - + name: can be formatted directly for entities with pattern values + asserts: + - + id: bar + attribute: attr + value: Bar Attribute + - + name: with simple pattern values + resources: + - + source: |- + foo = Foo + bar = Bar + .attr = { foo } Attribute + baz = { foo } Baz + .attr = { foo } Attribute + qux = Qux + .attr = { qux } Attribute + ref-bar = { bar.attr } + ref-baz = { baz.attr } + ref-qux = { qux.attr } + tests: + - + name: can be referenced for entities with string values + asserts: + - + id: ref-bar + value: Foo Attribute + - + name: can be formatted directly for entities with string values + asserts: + - + id: bar + attribute: attr + value: Foo Attribute + - + name: can be referenced for entities with simple pattern values + asserts: + - + id: ref-baz + value: Foo Attribute + - + name: can be formatted directly for entities with simple pattern values + asserts: + - + id: baz + attribute: attr + value: Foo Attribute + - + name: works with self-references + asserts: + - + id: ref-qux + value: Qux Attribute + - + name: can be formatted directly when it uses a self-reference + asserts: + - + id: qux + attribute: attr + value: Qux Attribute + - + name: with values with select expressions + resources: + - + source: |- + foo = Foo + .attr = { "a" -> + [a] A + *[b] B + } + ref-foo = { foo.attr } + tests: + - + name: can be referenced + asserts: + - + id: ref-foo + value: A + - + name: can be formatted directly + asserts: + - + id: foo + attribute: attr + value: A diff --git a/third_party/rust/fluent-bundle/tests/fixtures/bomb.yaml b/third_party/rust/fluent-bundle/tests/fixtures/bomb.yaml new file mode 100644 index 000000000000..e98d709549e4 --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/bomb.yaml @@ -0,0 +1,30 @@ +suites: + - + name: Reference bombs + suites: + - + name: Billion Laughs + resources: + - + source: |- + lol0 = LOL + lol1 = {lol0} {lol0} {lol0} {lol0} {lol0} {lol0} {lol0} {lol0} {lol0} {lol0} + lol2 = {lol1} {lol1} {lol1} {lol1} {lol1} {lol1} {lol1} {lol1} {lol1} {lol1} + lol3 = {lol2} {lol2} {lol2} {lol2} {lol2} {lol2} {lol2} {lol2} {lol2} {lol2} + lol4 = {lol3} {lol3} {lol3} {lol3} {lol3} {lol3} {lol3} {lol3} {lol3} {lol3} + lol5 = {lol4} {lol4} {lol4} {lol4} {lol4} {lol4} {lol4} {lol4} {lol4} {lol4} + lol6 = {lol5} {lol5} {lol5} {lol5} {lol5} {lol5} {lol5} {lol5} {lol5} {lol5} + lol7 = {lol6} {lol6} {lol6} {lol6} {lol6} {lol6} {lol6} {lol6} {lol6} {lol6} + lol8 = {lol7} {lol7} {lol7} {lol7} {lol7} {lol7} {lol7} {lol7} {lol7} {lol7} + lol9 = {lol8} {lol8} {lol8} {lol8} {lol8} {lol8} {lol8} {lol8} {lol8} {lol8} + lolz = {lol9} + tests: + - + name: does not expand all placeables + asserts: + - + id: lolz + value: "{lol9}" + errors: + - + type: TooManyPlaceables diff --git a/third_party/rust/fluent-bundle/tests/fixtures/context.yaml b/third_party/rust/fluent-bundle/tests/fixtures/context.yaml new file mode 100644 index 000000000000..89af1c5823a8 --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/context.yaml @@ -0,0 +1,195 @@ +suites: + - + name: Bundle + suites: + - + name: addResource + resources: + - + source: |- + foo = Foo + -bar = Bar + tests: + - + name: adds messages + asserts: + - + id: foo + value: Foo + - + id: bar + missing: true + - + name: allowOverrides + resources: + - + source: key = Foo + tests: + - + name: addResource allowOverrides is false + resources: + - + source: key = Bar + bundles: + - + errors: + - + type: Overriding + asserts: + - + id: key + value: Foo + - + name: addResource allowOverrides is true + skip: true + resources: + - + source: key = Bar + asserts: + - + id: key + value: Bar + - + name: hasMessage + resources: + - + source: |- + foo = Foo + bar = + .attr = Bar Attr + -term = Term + # ERROR No value. + err1 = + # ERROR Broken value. + err2 = {} + # ERROR No attribute value. + err3 = + .attr = + # ERROR Broken attribute value. + err4 = + .attr1 = Attr + .attr2 = {} + errors: + - + type: Parser + - + type: Parser + - + type: Parser + - + type: Parser + tests: + - + name: returns true only for public messages + asserts: + - + id: foo + missing: false + - + name: returns false for terms and missing messages + asserts: + - + id: -term + missing: true + - + id: missing + missing: true + - + id: -missing + missing: true + - + name: returns false for broken messages + asserts: + - + id: err1 + missing: true + - + id: err2 + missing: true + - + id: err3 + missing: true + - + id: err4 + # XXX: Difference from JS. We handle partial messages + missing: false + - + name: getMessage + resources: + - + source: |- + foo = Foo + -bar = Bar + tests: + - + name: returns public messages + asserts: + - + id: foo + missing: false + - + name: returns undefined for terms and missing messages + asserts: + - + id: -bar + missing: true + - + id: baz + missing: true + - + id: -baz + missing: true + - + name: (Rust) Entries + resources: + - + source: |- + -foo = Bar + baz = { foo } + qux = { -bar } + fn = { FN() } + tests: + - + name: Entry mismatch doesn't leak + asserts: + - + id: baz + value: "{foo}" + errors: + - + type: Reference + desc: "Unknown message: foo" + - + name: Missing term + asserts: + - + id: qux + value: "{-bar}" + errors: + - + type: Reference + desc: "Unknown term: -bar" + - + name: Missing function + asserts: + - + id: fn + value: "{FN()}" + errors: + - + type: Reference + desc: "Unknown function: FN()" + - + name: (Rust) FluentBundle construction + resources: + - + source: |- + foo = Foo + bundles: + - + functions: + - SUM + - SUM + errors: + - + type: Overriding \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/fixtures/defaults.yaml b/third_party/rust/fluent-bundle/tests/fixtures/defaults.yaml new file mode 100644 index 000000000000..5f6051c60250 --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/defaults.yaml @@ -0,0 +1,6 @@ +# Those are default settings for all tests + +bundle: + useIsolating: false + locales: + - en-US \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/fixtures/errors.yaml b/third_party/rust/fluent-bundle/tests/fixtures/errors.yaml new file mode 100644 index 000000000000..b488fb59da0a --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/errors.yaml @@ -0,0 +1,21 @@ +suites: + - + name: Errors + resources: + - + source: |- + foo = {$one} and {$two} + tests: + - + name: Reporting into an array + asserts: + - + id: foo + value: "{$one} and {$two}" + errors: + - + type: Reference + desc: "Unknown variable: $one" + - + type: Reference + desc: "Unknown variable: $two" \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/fixtures/functions.yaml b/third_party/rust/fluent-bundle/tests/fixtures/functions.yaml new file mode 100644 index 000000000000..c18afca177e0 --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/functions.yaml @@ -0,0 +1,85 @@ +suites: + - + name: Functions + suites: + - + name: missing + resources: + - + source: |- + foo = { MISSING("Foo") } + tests: + - + name: falls back to the name of the function + asserts: + - + id: foo + value: "{MISSING()}" + errors: + - + type: Reference + desc: "Unknown function: MISSING()" + - + name: arguments + resources: + - + source: |- + foo = Foo + .attr = Attribute + pass-nothing = { IDENTITY() } + pass-string = { IDENTITY("a") } + pass-number = { IDENTITY(1) } + pass-message = { IDENTITY(foo) } + pass-attr = { IDENTITY(foo.attr) } + pass-variable = { IDENTITY($var) } + pass-function-call = { IDENTITY(IDENTITY(1)) } + bundles: + - + functions: + - IDENTITY + tests: + - + name: falls back when arguments don't match the arity + asserts: + - + id: pass-nothing + ## XXX: Difference from JS + value: "???" + - + name: accepts strings + asserts: + - + id: pass-string + value: a + - + name: accepts numbers + asserts: + - + id: pass-number + value: 1 + - + name: accepts entities + asserts: + - + id: pass-message + value: Foo + - + name: accepts attributes + asserts: + - + id: pass-attr + value: Attribute + - + name: accepts variables + asserts: + - + id: pass-variable + args: + var: Variable + value: Variable + - + name: accepts function calls + asserts: + - + id: pass-function-call + value: 1 \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/fixtures/functions_runtime.yaml b/third_party/rust/fluent-bundle/tests/fixtures/functions_runtime.yaml new file mode 100644 index 000000000000..1acebbef5188 --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/functions_runtime.yaml @@ -0,0 +1,29 @@ +suites: + - + name: Runtime-specific functions + suites: + - + name: passing into the constructor + resources: + - + source: |- + foo = { CONCAT("Foo", "Bar") } + bar = { SUM(1, 2) } + bundles: + - + functions: + - CONCAT + - SUM + tests: + - + name: works for strings + asserts: + - + id: foo + value: FooBar + - + name: works for numbers + asserts: + - + id: bar + value: 3 \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/fixtures/isolating.yaml b/third_party/rust/fluent-bundle/tests/fixtures/isolating.yaml new file mode 100644 index 000000000000..7f00b6e5320c --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/isolating.yaml @@ -0,0 +1,100 @@ +suites: + - + name: Isolating interpolations + resources: + - + source: |- + foo = Foo + bar = { foo } Bar + baz = { $arg } Baz + qux = { bar } { baz } + bundles: + - + useIsolating: true + tests: + - + name: isolates interpolated message references + skip: true + asserts: + - + id: bar + value: "\u2068Foo\u2069 Bar" + - + name: isolates interpolated string-typed variables + asserts: + - + id: baz + args: + arg: Arg + value: "\u2068Arg\u2069 Baz" + - + name: isolates interpolated number-typed variables + asserts: + - + id: baz + args: + arg: 1 + value: "\u20681\u2069 Baz" + - + name: isolates interpolated date-typed variables + skip: true + asserts: + - + id: baz + args: + arg: 1976-07-31 + value: "\u20681976-07-31\u2069 Baz" + - + name: isolates complex interpolations + skip: true + asserts: + - + id: qux + args: + arg: Arg + value: "\u2068\u2068Foo\u2069 Bar\u2069 \u2068\u2068Arg\u2069 Baz\u2069" + - + name: Skip isolation cases + resources: + - + source: |- + -brand-short-name = Amaya + foo = { -brand-short-name } + bundles: + - + useIsolating: true + tests: + - + name: skips isolation if the only element is a placeable + asserts: + - + id: foo + value: "Amaya" + - + name: (Rust) Skip isolation of string literals and terms + resources: + - + source: |- + rs-bar = Foo { $foo } { "Bar" } baz + -rs-term = My Term + rs-baz = Foo { $foo } { -rs-term } baz + bundles: + - + useIsolating: true + tests: + - + name: skip isolation of string literals + asserts: + - + id: rs-bar + args: + foo: Test + value: "Foo \u2068Test\u2069 Bar baz" + - + name: skip isolation of term references + asserts: + - + id: rs-baz + args: + foo: Test + value: "Foo \u2068Test\u2069 My Term baz" \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/fixtures/literals.yaml b/third_party/rust/fluent-bundle/tests/fixtures/literals.yaml new file mode 100644 index 000000000000..aadc5b525b87 --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/literals.yaml @@ -0,0 +1,69 @@ +suites: + - + name: Literals as selectors + tests: + - + name: a matching string literal selector + resources: + - + source: |- + foo = { "a" -> + [a] A + *[b] B + } + asserts: + - + id: foo + value: A + - + name: a non-matching string literal selector + resources: + - + source: |- + foo = { "c" -> + [a] A + *[b] B + } + asserts: + - + id: foo + value: B + - + name: a matching number literal selector + resources: + - + source: |- + foo = { 0 -> + [0] A + *[1] B + } + asserts: + - + id: foo + value: A + - + name: a non-matching number literal selector + resources: + - + source: |- + foo = { 2 -> + [0] A + *[1] B + } + asserts: + - + id: foo + value: B + - + name: a number literal selector matching a plural category + resources: + - + source: |- + foo = { 1 -> + [one] A + *[other] B + } + asserts: + - + id: foo + value: A \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/fixtures/macros.yaml b/third_party/rust/fluent-bundle/tests/fixtures/macros.yaml new file mode 100644 index 000000000000..eb0c2d40d162 --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/macros.yaml @@ -0,0 +1,392 @@ +suites: + - + name: Macros + suites: + - + name: References and calls + resources: + - + source: |- + -bar = Bar + term-ref = {-bar} + term-call = {-bar()} + tests: + - + name: terms can be referenced without parens + asserts: + - + id: term-ref + value: Bar + - + name: terms can be parameterized + asserts: + - + id: term-call + value: Bar + - + name: Passing arguments + resources: + - + source: |- + -foo = Foo {$arg} + ref-foo = {-foo} + call-foo-no-args = {-foo()} + call-foo-with-expected-arg = {-foo(arg: 1)} + call-foo-with-other-arg = {-foo(other: 3)} + tests: + - + name: Not parameterized, no externals + asserts: + - + id: ref-foo + value: Foo {$arg} + - + name: Not parameterized but with externals + asserts: + - + id: ref-foo + args: + arg: 1 + value: Foo {$arg} + - + name: No arguments, no externals + asserts: + - + id: call-foo-no-args + value: Foo {$arg} + - + name: No arguments, but with externals + asserts: + - + id: call-foo-no-args + args: + arg: 1 + value: Foo {$arg} + - + name: With expected args, no externals + asserts: + - + id: call-foo-with-expected-arg + value: Foo 1 + - + name: With expected args, and with externals + asserts: + - + id: call-foo-with-expected-arg + args: + arg: 5 + value: Foo 1 + - + name: With other args, no externals + asserts: + - + id: call-foo-with-other-arg + value: Foo {$arg} + - + name: With other args, and with externals + asserts: + - + id: call-foo-with-other-arg + args: + arg: 5 + value: Foo {$arg} + - + name: Nesting message references + resources: + - + source: |- + foo = Foo {$arg} + -bar = {foo} + ref-bar = {-bar} + call-bar = {-bar()} + call-bar-with-arg = {-bar(arg: 1)} + tests: + - + name: No parameterization, no externals + asserts: + - + id: ref-bar + value: Foo {$arg} + - + name: No parameterization, but with externals + asserts: + - + id: ref-bar + args: + arg: 5 + value: Foo {$arg} + - + name: No arguments, no externals + asserts: + - + id: call-bar + value: Foo {$arg} + - + name: No arguments, but with externals + asserts: + - + id: call-bar + args: + arg: 5 + value: Foo {$arg} + - + name: With arguments, no externals + asserts: + - + id: call-bar-with-arg + value: Foo 1 + - + name: With arguments and with externals + asserts: + - + id: call-bar-with-arg + args: + arg: 5 + value: Foo 1 + - + name: Nesting term references + resources: + - + source: |- + -foo = Foo {$arg} + -bar = {-foo} + -baz = {-foo()} + -qux = {-foo(arg: 1)} + ref-bar = {-bar} + ref-baz = {-baz} + ref-qux = {-qux} + call-bar-no-args = {-bar()} + call-baz-no-args = {-baz()} + call-qux-no-args = {-qux()} + call-bar-with-arg = {-bar(arg: 2)} + call-baz-with-arg = {-baz(arg: 2)} + call-qux-with-arg = {-qux(arg: 2)} + call-qux-with-other = {-qux(other: 3)} + tests: + - + name: No parameterization, no parameterization, no externals + asserts: + - + id: ref-bar + value: Foo {$arg} + - + name: No parameterization, no parameterization, with externals + asserts: + - + id: ref-bar + args: + arg: 5 + value: Foo {$arg} + - + name: No parameterization, no arguments, no externals + asserts: + - + id: ref-baz + value: Foo {$arg} + - + name: No parameterization, no arguments, with externals + asserts: + - + id: ref-baz + args: + arg: 5 + value: Foo {$arg} + - + name: No parameterization, with arguments, no externals + asserts: + - + id: ref-qux + value: Foo 1 + - + name: No parameterization, with arguments, with externals + asserts: + - + id: ref-qux + args: + arg: 5 + value: Foo 1 + - + name: No arguments, no parametrization, no externals + asserts: + - + id: call-bar-no-args + value: Foo {$arg} + - + name: No arguments, no parametrization, with externals + asserts: + - + id: call-bar-no-args + args: + arg: 5 + value: Foo {$arg} + - + name: No arguments, no arguments, no externals + asserts: + - + id: call-baz-no-args + value: Foo {$arg} + - + name: No arguments, no arguments, with externals + asserts: + - + id: call-baz-no-args + args: + arg: 5 + value: Foo {$arg} + - + name: No arguments, with arguments, no externals + asserts: + - + id: call-qux-no-args + value: Foo 1 + - + name: No arguments, with arguments, with externals + asserts: + - + id: call-qux-no-args + args: + arg: 5 + value: Foo 1 + - + name: With arguments, no parametrization, no externals + asserts: + - + id: call-bar-with-arg + value: Foo {$arg} + - + name: With arguments, no parametrization, with externals + asserts: + - + id: call-bar-with-arg + args: + arg: 5 + value: Foo {$arg} + - + name: With arguments, no arguments, no externals + asserts: + - + id: call-baz-with-arg + value: Foo {$arg} + - + name: With arguments, no arguments, with externals + asserts: + - + id: call-baz-with-arg + args: + arg: 5 + value: Foo {$arg} + - + name: With arguments, with arguments, no externals + asserts: + - + id: call-qux-with-arg + value: Foo 1 + - + name: With arguments, with arguments, with externals + asserts: + - + id: call-qux-with-arg + args: + arg: 5 + value: Foo 1 + - + name: With unexpected arguments, with arguments, no externals + asserts: + - + id: call-qux-with-other + value: Foo 1 + - + name: With unexpected arguments, with arguments, with externals + asserts: + - + id: call-qux-with-other + args: + arg: 5 + value: Foo 1 + - + name: Parameterized term attributes + resources: + - + source: |- + -ship = Ship + .gender = {$style -> + *[traditional] neuter + [chicago] feminine + } + ref-attr = {-ship.gender -> + *[masculine] He + [feminine] She + [neuter] It + } + call-attr-no-args = {-ship.gender() -> + *[masculine] He + [feminine] She + [neuter] It + } + call-attr-with-expected-arg = {-ship.gender(style: "chicago") -> + *[masculine] He + [feminine] She + [neuter] It + } + call-attr-with-other-arg = {-ship.gender(other: 3) -> + *[masculine] He + [feminine] She + [neuter] It + } + tests: + - + name: Not parameterized, no externals + asserts: + - + id: ref-attr + value: It + - + name: Not parameterized but with externals + asserts: + - + id: ref-attr + args: + attr: chicago + value: It + - + name: No arguments, no externals + asserts: + - + id: call-attr-no-args + value: It + - + name: No arguments, but with externals + asserts: + - + id: call-attr-no-args + args: + style: chicago + value: It + - + name: With expected args, no externals + asserts: + - + id: call-attr-with-expected-arg + value: She + - + name: With expected args, and with externals + asserts: + - + id: call-attr-with-expected-arg + args: + style: chicago + value: She + - + name: With other args, no externals + asserts: + - + id: call-attr-with-other-arg + value: It + - + name: With other args, and with externals + asserts: + - + id: call-attr-with-other-arg + args: + style: chicago + value: It \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/fixtures/patterns.yaml b/third_party/rust/fluent-bundle/tests/fixtures/patterns.yaml new file mode 100644 index 000000000000..167962f7b0b4 --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/patterns.yaml @@ -0,0 +1,218 @@ +suites: + - + name: Patterns + suites: + - + name: Simple string value + resources: + - + source: foo = Foo + tests: + - + name: returns the value + asserts: + - + id: foo + value: Foo + - + name: Complex string value + resources: + - + source: |- + foo = Foo + -bar = Bar + ref-message = { foo } + ref-term = { -bar } + ref-missing-message = { missing } + ref-missing-term = { -missing } + ref-malformed = { malformed + errors: + - + type: Parser + tests: + - + name: resolves the reference to a message + asserts: + - + id: ref-message + value: Foo + - + name: resolves the reference to a term + asserts: + - + id: ref-term + value: Bar + - + name: returns the id if a message reference is missing + asserts: + - + id: ref-missing-message + value: "{missing}" + errors: + - + type: Reference + desc: "Unknown message: missing" + - + name: returns the id if a term reference is missing + asserts: + - + id: ref-missing-term + value: "{-missing}" + errors: + - + type: Reference + desc: "Unknown term: -missing" + - + name: Complex string referencing a message with null value + resources: + - + source: |- + foo = + .attr = Foo Attr + bar = { foo } Bar + tests: + - + name: returns the null value + skip: true + asserts: + - + id: foo + value: Foo + - + name: formats the attribute + asserts: + - + id: foo + attribute: attr + value: Foo Attr + - + name: formats ??? when the referenced message has no value and no default + asserts: + - + id: bar + # XXX: Difference from JS + value: "{foo} Bar" + errors: + - + type: Reference + desc: "Unknown message: foo" + - + name: Cyclic reference + resources: + - + source: |- + foo = { bar } + bar = { foo } + tests: + - + name: returns ??? + asserts: + - + id: foo + value: "{foo}" + errors: + - + type: Cyclic + - + name: Cyclic self-reference + resources: + - + source: foo = { foo } + tests: + - + name: returns the raw string + asserts: + - + id: foo + value: "{foo}" + errors: + - + type: Cyclic + - + name: Cyclic self-reference in a member + resources: + - + source: |- + foo = + { $sel -> + *[a] { foo } + [b] Bar + } + bar = { foo } + tests: + - + name: returns ??? + asserts: + - + id: foo + args: + sel: a + value: "{foo}" + errors: + - + type: Cyclic + - + name: returns the other member if requested + asserts: + - + id: foo + args: + sel: b + value: Bar + - + name: Cyclic reference in a selector + skip: true + resources: + - + source: |- + -foo = + { -bar.attr -> + *[a] Foo + } + -bar = Bar + .attr = { -foo } + foo = { -foo } + tests: + - + name: returns the default variant + asserts: + - + id: foo + value: Foo + errors: + - + type: Cyclic + - + name: Cyclic self-reference in a selector + skip: true + resources: + - + source: |- + -foo = + { -bar.attr -> + *[a] Foo + } + .attr = a + -bar = + { -foo.attr -> + *[a] Bar + } + .attr = { -foo } + foo = { -foo } + bar = { -bar } + tests: + - + name: returns the default variant + asserts: + - + id: foo + value: Foo + errors: + - + type: Cyclic + - + name: can reference an attribute + asserts: + - + id: bar + value: Bar \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/fixtures/primitives.yaml b/third_party/rust/fluent-bundle/tests/fixtures/primitives.yaml new file mode 100644 index 000000000000..3b73984312b1 --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/primitives.yaml @@ -0,0 +1,154 @@ +suites: + - + name: Primitives + suites: + - + name: Numbers + resources: + - + source: |- + one = { 1 } + select = { 1 -> + *[0] Zero + [1] One + } + tests: + - + name: can be used in a placeable + asserts: + - + id: one + value: 1 + - + name: can be used as a selector + asserts: + - + id: select + value: One + - + name: Simple string value + resources: + - + source: |- + foo = Foo + placeable-literal = { "Foo" } Bar + placeable-message = { foo } Bar + selector-literal = { "Foo" -> + *[Foo] Member 1 + } + bar = + .attr = Bar Attribute + placeable-attr = { bar.attr } + -baz = Baz + .attr = BazAttribute + selector-attr = { -baz.attr -> + *[BazAttribute] Member 3 + } + tests: + - + name: can be used as a value + asserts: + - + id: foo + value: Foo + - + name: can be used in a placeable + asserts: + - + id: placeable-literal + value: Foo Bar + - + name: can be a value of a message referenced in a placeable + asserts: + - + id: placeable-message + value: Foo Bar + - + name: can be a selector + asserts: + - + id: selector-literal + value: Member 1 + - + name: can be used as an attribute value + asserts: + - + id: bar + attribute: attr + value: Bar Attribute + - + name: can be a value of an attribute used in a placeable + asserts: + - + id: placeable-attr + value: Bar Attribute + - + name: can be a value of an attribute used as a selector + asserts: + - + id: selector-attr + value: Member 3 + - + name: Complex string value + resources: + - + source: |- + foo = Foo + bar = { foo }Bar + placeable-message = { bar }Baz + baz = + .attr = { bar }BazAttribute + -bazTerm = Value + .attr = { bar }BazAttribute + placeable-attr = { baz.attr } + # XXX: This is different from JS fixture which + # illegally uses message attribute as selector. + selector-attr = { -bazTerm.attr -> + [FooBarBazAttribute] FooBarBaz + *[other] Other + } + tests: + - + name: can be used as a value + asserts: + - + id: bar + value: FooBar + - + name: can be a value of a message referenced in a placeable + asserts: + - + id: placeable-message + value: FooBarBaz + - + name: can be used as an attribute value + asserts: + - + id: baz + attribute: attr + value: FooBarBazAttribute + - + name: can be a value of an attribute used in a placeable + asserts: + - + id: placeable-attr + value: FooBarBazAttribute + - + name: can be a value of an attribute used as a selector + asserts: + - + id: selector-attr + value: FooBarBaz + - + name: (Rust) Placeable + resources: + - + source: |- + foo = { { "Foo" } } + tests: + - + name: Placeable in placable work + asserts: + - + id: foo + value: Foo \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/fixtures/select_expression.yaml b/third_party/rust/fluent-bundle/tests/fixtures/select_expression.yaml new file mode 100644 index 000000000000..b8729c497de8 --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/select_expression.yaml @@ -0,0 +1,151 @@ +suites: + - + name: Select expressions + tests: + - + name: missing selector + resources: + - + source: |- + select = {$none -> + [a] A + *[b] B + } + asserts: + - + id: select + value: B + errors: + - + type: Reference + desc: "Unknown variable: $none" + suites: + - + name: string selectors + tests: + - + name: matching selector + resources: + - + source: |- + select = {$selector -> + [a] A + *[b] B + } + asserts: + - + id: select + value: A + args: + selector: a + - + name: non-matching selector + resources: + - + source: |- + select = {$selector -> + [a] A + *[b] B + } + asserts: + - + id: select + value: B + args: + selector: c + - + name: number selectors + tests: + - + name: matching selector + resources: + - + source: |- + select = {$selector -> + [0] A + *[1] B + } + asserts: + - + id: select + value: A + args: + selector: 0 + - + name: non-matching selector + resources: + - + source: |- + select = {$selector -> + [0] A + *[1] B + } + asserts: + - + id: select + value: B + args: + selector: 2 + - + name: plural categories + tests: + - + name: matching number selector + resources: + - + source: |- + select = {$selector -> + [one] A + *[other] B + } + asserts: + - + id: select + value: A + args: + selector: 1 + - + name: matching string selector + resources: + - + source: |- + select = {$selector -> + [one] A + *[other] B + } + asserts: + - + id: select + value: A + args: + selector: one + - + name: non-matching number selector + resources: + - + source: |- + select = {$selector -> + [one] A + *[default] D + } + asserts: + - + id: select + value: D + args: + selector: 2 + - + name: non-matching string selector + resources: + - + source: |- + select = {$selector -> + [one] A + *[default] D + } + asserts: + - + id: select + value: D + args: + selector: other \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/fixtures/transform.yaml b/third_party/rust/fluent-bundle/tests/fixtures/transform.yaml new file mode 100644 index 000000000000..190d0069283d --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/transform.yaml @@ -0,0 +1,48 @@ +suites: + - + name: Transformations + resources: + - + source: |- + foo = Faa + .bar = Bar {foo} Baz + bar = Bar {"Baz"} + qux = {"faa" -> + [faa] Faa + *[bar] Bar + } + arg = Faa {$arg} + bundles: + - + transform: example + tests: + - + name: transforms TextElements + asserts: + - + id: foo + value: FAA + - + id: foo + attribute: bar + value: BAr FAA BAz + - + name: does not transform StringLiterls + asserts: + - + id: bar + value: BAr Baz + - + name: does not transform VariantKeys + asserts: + - + id: qux + value: FAA + - + name: does not transform Variables + asserts: + - + id: arg + args: + arg: aaa + value: FAA aaa \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/fixtures/values_format.yaml b/third_party/rust/fluent-bundle/tests/fixtures/values_format.yaml new file mode 100644 index 000000000000..90688f4b49b1 --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/values_format.yaml @@ -0,0 +1,74 @@ +suites: + - + name: Formatting values + resources: + - + source: |- + key1 = Value 1 + key2 = { $sel -> + [a] A2 + *[b] B2 + } + key3 = Value { 3 } + key4 = { $sel -> + [a] A{ 4 } + *[b] B{ 4 } + } + key5 = + .a = A5 + .b = B5 + tests: + - + name: returns the value + asserts: + - + id: key1 + value: Value 1 + - + name: returns the default variant + asserts: + - + id: key2 + value: B2 + errors: + - + type: Reference + desc: "Unknown variable: $sel" + - + name: returns the value if it is a pattern + asserts: + - + id: key3 + value: Value 3 + - + name: returns the default variant if it is a pattern + asserts: + - + id: key4 + value: B4 + errors: + - + type: Reference + desc: "Unknown variable: $sel" + - + name: returns {???} when trying to format a null value + skip: true + asserts: + - + id: key5 + value: "{???}" + errors: + - + type: Reference + desc: "Unknown variable: $sel" + - + name: allows to pass traits directly to bundle.formatPattern + asserts: + - + id: key5 + attribute: a + value: "A5" + - + id: key5 + attribute: b + value: "B5" \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/fixtures/values_ref.yaml b/third_party/rust/fluent-bundle/tests/fixtures/values_ref.yaml new file mode 100644 index 000000000000..cd78d871410b --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/fixtures/values_ref.yaml @@ -0,0 +1,140 @@ +suites: + - + name: Referencing values + resources: + - + source: |- + key1 = Value 1 + -key2 = { $sel -> + [a] A2 + *[b] B2 + } + key3 = Value { 3 } + -key4 = { $sel -> + [a] A{ 4 } + *[b] B{ 4 } + } + key5 = + .a = A5 + .b = B5 + ref1 = { key1 } + ref2 = { -key2 } + ref3 = { key3 } + ref4 = { -key4 } + ref5 = { key5 } + ref6 = { -key2(sel: "a") } + ref7 = { -key2(sel: "b") } + ref8 = { -key4(sel: "a") } + ref9 = { -key4(sel: "b") } + ref10 = { key5.a } + ref11 = { key5.b } + ref12 = { key5.c } + ref13 = { key6 } + ref14 = { key6.a } + ref15 = { -key6 } + ref16 = { -key6.a -> + *[a] A + } + tests: + - + name: references the value + asserts: + - + id: ref1 + value: Value 1 + - + name: references the default variant + asserts: + - + id: ref2 + value: B2 + - + name: references the value if it is a pattern + asserts: + - + id: ref3 + value: Value 3 + - + name: references the default variant if it is a pattern + asserts: + - + id: ref4 + value: B4 + - + name: falls back to id if there is no value + asserts: + - + id: ref5 + value: "{key5}" + errors: + - + type: Reference + desc: "Unknown message: key5" + - + name: references the variants + asserts: + - + id: ref6 + value: A2 + - + id: ref7 + value: B2 + - + name: references the variants which are patterns + asserts: + - + id: ref8 + value: A4 + - + id: ref9 + value: B4 + - + name: references the attributes + asserts: + - + id: ref10 + value: A5 + - + id: ref11 + value: B5 + - + id: ref12 + value: "{key5.c}" + errors: + - + type: Reference + desc: "Unknown attribute: key5.c" + - + name: missing message reference + asserts: + - + id: ref13 + value: "{key6}" + errors: + - + type: Reference + desc: "Unknown message: key6" + - + id: ref14 + value: "{key6.a}" + errors: + - + type: Reference + desc: "Unknown attribute: key6.a" + - + name: missing term reference + asserts: + - + id: ref15 + value: "{-key6}" + errors: + - + type: Reference + desc: "Unknown term: -key6" + - + id: ref16 + value: "A" + errors: + - + type: Reference + desc: "Unknown attribute: -key6.a" \ No newline at end of file diff --git a/third_party/rust/fluent-bundle/tests/helpers/mod.rs b/third_party/rust/fluent-bundle/tests/helpers/mod.rs new file mode 100644 index 000000000000..ec65db100e8f --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/helpers/mod.rs @@ -0,0 +1,202 @@ +use std::collections::HashMap; +use std::fs::File; +use std::io; +use std::io::Read; + +use serde::{Deserialize, Serialize}; + +#[macro_export] +macro_rules! test { + ($desc:stmt, $closure:block) => {{ + $closure + }}; +} + +#[macro_export] +macro_rules! assert_format { + ($bundle:expr, $id:expr, $args:expr, $expected:expr) => { + let msg = $bundle.get_message($id).expect("Message doesn't exist"); + let mut errors = vec![]; + assert!(msg.value.is_some()); + assert_eq!( + $bundle.format_pattern(&msg.value.unwrap(), $args, &mut errors), + $expected + ); + assert!(errors.is_empty()); + }; + ($bundle:expr, $id:expr, $args:expr, $expected:expr, $errors:expr) => { + let msg = $bundle.get_message($id).expect("Message doesn't exist."); + let mut errors = vec![]; + assert!(msg.value.is_some()); + assert_eq!( + $bundle.format_pattern(&msg.value.unwrap(), $args, &mut errors), + $expected + ); + assert_eq!(errors, $errors); + }; +} + +#[macro_export] +macro_rules! assert_format_none { + ($bundle:expr, $id:expr) => { + let msg = $bundle.get_message($id).expect("Message doesn't exist"); + assert!(msg.value.is_none()); + }; +} + +#[macro_export] +macro_rules! assert_format_attr { + ($bundle:expr, $id:expr, $name:expr, $args:expr, $expected:expr) => { + let msg = $bundle.get_message($id).expect("Message doesn't exists"); + let mut errors = vec![]; + let attr = msg.attributes.get($name).expect("Attribute exists"); + assert_eq!($bundle.format_pattern(&attr, $args, &mut errors), $expected); + assert!(errors.is_empty()); + }; +} + +#[macro_export] +macro_rules! assert_get_resource_from_str { + ($source:expr) => { + FluentResource::try_new($source.to_owned()).expect("Failed to parse an FTL resource.") + }; +} + +#[macro_export] +macro_rules! assert_get_bundle { + ($res:expr) => {{ + let mut bundle: FluentBundle<&FluentResource> = FluentBundle::new(&["x-testing"]); + bundle.set_use_isolating(false); + bundle + .add_resource($res) + .expect("Failed to add FluentResource to FluentBundle."); + bundle + }}; +} + +pub fn get_fixture(path: &str) -> Result { + let mut f = File::open(path)?; + let mut s = String::new(); + f.read_to_string(&mut s)?; + Ok(serde_yaml::from_str(&s).expect("Parsing YAML failed.")) +} + +pub fn get_defaults(path: &str) -> Result { + let mut f = File::open(path)?; + let mut s = String::new(); + f.read_to_string(&mut s)?; + Ok(serde_yaml::from_str(&s).expect("Parsing YAML failed.")) +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(deny_unknown_fields)] +pub struct TestBundle { + pub name: Option, + pub locales: Option>, + pub resources: Option>, + #[serde(rename = "useIsolating")] + pub use_isolating: Option, + pub functions: Option>, + pub transform: Option, + #[serde(skip_serializing_if = "Vec::is_empty", default)] + pub errors: Vec, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(deny_unknown_fields)] +pub struct TestResource { + pub name: Option, + #[serde(skip_serializing_if = "Vec::is_empty", default)] + pub errors: Vec, + pub source: String, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(deny_unknown_fields)] +pub struct TestSetup { + #[serde(skip_serializing_if = "Vec::is_empty", default)] + pub bundles: Vec, + #[serde(skip_serializing_if = "Vec::is_empty", default)] + pub resources: Vec, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(deny_unknown_fields)] +pub struct TestError { + #[serde(rename = "type")] + pub error_type: String, + pub desc: Option, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(deny_unknown_fields)] +#[serde(untagged)] +pub enum TestArgumentValue { + String(String), + Number(f64), +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(deny_unknown_fields)] +pub struct TestAssert { + pub bundle: Option, + pub id: String, + pub attribute: Option, + pub value: Option, + pub args: Option>, + #[serde(skip_serializing_if = "Vec::is_empty", default)] + pub errors: Vec, + pub missing: Option, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(deny_unknown_fields)] +pub struct Test { + pub name: String, + pub skip: Option, + + #[serde(skip_serializing_if = "Vec::is_empty", default)] + pub bundles: Vec, + #[serde(skip_serializing_if = "Vec::is_empty", default)] + pub resources: Vec, + + pub asserts: Vec, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(deny_unknown_fields)] +pub struct TestSuite { + pub name: String, + pub skip: Option, + + #[serde(skip_serializing_if = "Vec::is_empty", default)] + pub bundles: Vec, + #[serde(skip_serializing_if = "Vec::is_empty", default)] + pub resources: Vec, + + #[serde(skip_serializing_if = "Vec::is_empty", default)] + pub tests: Vec, + #[serde(skip_serializing_if = "Vec::is_empty", default)] + pub suites: Vec, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(deny_unknown_fields)] +pub struct TestFixture { + pub suites: Vec, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(deny_unknown_fields)] +pub struct BundleDefaults { + #[serde(rename = "useIsolating")] + pub use_isolating: Option, + pub transform: Option, + pub locales: Option>, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(deny_unknown_fields)] +pub struct TestDefaults { + pub bundle: BundleDefaults, +} diff --git a/third_party/rust/fluent-bundle/tests/resolver_fixtures.rs b/third_party/rust/fluent-bundle/tests/resolver_fixtures.rs new file mode 100644 index 000000000000..7cd65b84f1f0 --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/resolver_fixtures.rs @@ -0,0 +1,363 @@ +mod helpers; + +use std::borrow::Cow; +use std::collections::HashMap; +use std::fs; +use std::iter; +use std::path::Path; + +use fluent_bundle::resolve::ResolverError; +use fluent_bundle::FluentArgs; +use fluent_bundle::FluentError; +use fluent_bundle::{FluentBundle as FluentBundleGeneric, FluentResource, FluentValue}; +use rand::distributions::Alphanumeric; +use rand::{thread_rng, Rng}; +use unic_langid::LanguageIdentifier; + +use helpers::*; + +type FluentBundle = FluentBundleGeneric; + +fn transform_example(s: &str) -> Cow { + s.replace("a", "A").into() +} + +#[derive(Clone)] +struct ScopeLevel { + name: String, + resources: Vec, + bundles: Vec, +} + +#[derive(Clone)] +struct Scope(Vec); + +impl Scope { + fn get_path(&self) -> String { + self.0 + .iter() + .map(|lvl| lvl.name.as_str()) + .collect::>() + .join(" > ") + } + + fn get_bundles(&self, defaults: &Option) -> HashMap { + let mut bundles = HashMap::new(); + + let mut available_resources = vec![]; + + for lvl in self.0.iter() { + for r in lvl.resources.iter() { + available_resources.push(r); + } + + for b in lvl.bundles.iter() { + let name = b + .name + .as_ref() + .cloned() + .unwrap_or_else(|| generate_random_hash()); + let bundle = create_bundle(Some(b), &defaults, &available_resources); + bundles.insert(name, bundle); + } + } + if bundles.is_empty() { + let bundle = create_bundle(None, defaults, &available_resources); + let name = generate_random_hash(); + bundles.insert(name.clone(), bundle); + } + bundles + } +} + +fn generate_random_hash() -> String { + let mut rng = thread_rng(); + let chars: String = iter::repeat(()) + .map(|()| rng.sample(Alphanumeric)) + .take(7) + .collect(); + chars +} + +fn test_fixture(fixture: &TestFixture, defaults: &Option) { + for suite in &fixture.suites { + test_suite(&suite, defaults, Scope(vec![])); + } +} + +fn create_bundle( + b: Option<&TestBundle>, + defaults: &Option, + resources: &Vec<&TestResource>, +) -> FluentBundle { + let mut errors = vec![]; + + let locales: Vec = b + .and_then(|b| b.locales.as_ref()) + .or_else(|| { + defaults + .as_ref() + .and_then(|defaults| defaults.bundle.locales.as_ref()) + }) + .map(|locs| { + locs.into_iter() + .map(|s| s.parse().expect("Parsing failed.")) + .collect() + }) + .expect("Failed to calculate locales."); + let mut bundle = FluentBundle::new(&locales); + let use_isolating = b.and_then(|b| b.use_isolating).or_else(|| { + defaults + .as_ref() + .and_then(|defaults| defaults.bundle.use_isolating) + }); + if let Some(use_isolating) = use_isolating { + bundle.set_use_isolating(use_isolating); + } + let transform = b.and_then(|b| b.transform.as_ref()).or_else(|| { + defaults + .as_ref() + .and_then(|defaults| defaults.bundle.transform.as_ref()) + }); + if let Some(transform) = transform { + match transform.as_str() { + "example" => bundle.set_transform(Some(transform_example)), + _ => unimplemented!(), + } + } + if let Some(&TestBundle { + functions: Some(ref fns), + .. + }) = b + { + for f in fns { + let result = match f.as_str() { + "CONCAT" => bundle.add_function(f.as_str(), |args, _name_args| { + args.iter() + .fold(String::new(), |acc, x| match x { + FluentValue::String(s) => acc + &s.to_string(), + FluentValue::Number(n) => acc + &n.value.to_string(), + _ => acc, + }) + .into() + }), + "SUM" => bundle.add_function(f.as_str(), |args, _name_args| { + args.iter() + .fold(0.0, |acc, x| { + if let FluentValue::Number(v) = x { + acc + v.value + } else { + panic!("Type cannot be used in SUM"); + } + }) + .into() + }), + "IDENTITY" => bundle.add_function(f.as_str(), |args, _name_args| { + args.get(0).cloned().unwrap_or(FluentValue::None) + }), + "NUMBER" => bundle.add_function(f.as_str(), |args, _name_args| { + args.get(0).expect("Argument must be passed").clone() + }), + _ => unimplemented!("No such function."), + }; + if let Err(err) = result { + errors.push(err); + } + } + } + let res_subset = b.and_then(|b| b.resources.as_ref()); + + for res in resources.iter() { + if let Some(res_subset) = res_subset { + if let Some(ref name) = res.name { + if !res_subset.contains(name) { + continue; + } + } + } + let res = get_resource(res); + if let Err(mut err) = bundle.add_resource(res) { + errors.append(&mut err); + } + } + test_errors(&errors, b.map(|b| b.errors.as_ref())); + bundle +} + +fn get_resource(resource: &TestResource) -> FluentResource { + let res = FluentResource::try_new(resource.source.clone()); + + if resource.errors.is_empty() { + res.expect("Failed to parse an FTL resource.") + } else { + let (res, errors) = match res { + Ok(r) => (r, vec![]), + Err((res, err)) => { + let err = err.into_iter().map(|err| err.into()).collect(); + (res, err) + } + }; + test_errors(&errors, Some(&resource.errors)); + res + } +} + +fn test_suite(suite: &TestSuite, defaults: &Option, mut scope: Scope) { + if suite.skip == Some(true) { + return; + } + + scope.0.push(ScopeLevel { + name: suite.name.clone(), + bundles: suite.bundles.clone(), + resources: suite.resources.clone(), + }); + + for test in &suite.tests { + test_test(test, defaults, scope.clone()); + } + + for sub_suite in &suite.suites { + test_suite(sub_suite, defaults, scope.clone()); + } +} + +fn test_test(test: &Test, defaults: &Option, mut scope: Scope) { + if test.skip == Some(true) { + return; + } + + scope.0.push(ScopeLevel { + name: test.name.clone(), + bundles: test.bundles.clone(), + resources: test.resources.clone(), + }); + + for assert in &test.asserts { + let bundles = scope.get_bundles(defaults); + let bundle = if let Some(ref bundle_name) = assert.bundle { + bundles + .get(bundle_name) + .expect("Failed to retrieve bundle.") + } else if bundles.len() == 1 { + let name = bundles.keys().into_iter().last().unwrap(); + bundles.get(name).expect("Failed to retrieve bundle.") + } else { + panic!(); + }; + let mut errors = vec![]; + + if let Some(expected_missing) = assert.missing { + let missing = if let Some(ref attr) = assert.attribute { + if let Some(msg) = bundle.get_message(&assert.id) { + msg.attributes.contains_key(attr.as_str()) + } else { + false + } + } else { + !bundle.has_message(&assert.id) + }; + assert_eq!( + missing, + expected_missing, + "Expected pattern to be `missing: {}` for {} in {}", + expected_missing, + assert.id, + scope.get_path() + ); + } else { + if let Some(ref expected_value) = assert.value { + let msg = bundle.get_message(&assert.id).expect(&format!( + "Failed to retrieve message `{}` in {}.", + &assert.id, + scope.get_path() + )); + let val = if let Some(ref attr) = assert.attribute { + msg.attributes.get(attr.as_str()).expect(&format!( + "Failed to retrieve an attribute of a message {}.{}.", + assert.id, attr + )) + } else { + msg.value.expect(&format!( + "Failed to retrieve a value of a message {}.", + assert.id + )) + }; + + let args: Option = assert.args.as_ref().map(|args| { + args.iter() + .map(|(k, v)| { + let val = match v { + TestArgumentValue::String(s) => s.as_str().into(), + TestArgumentValue::Number(n) => n.into(), + }; + (k.as_str(), val) + }) + .collect() + }); + let value = bundle.format_pattern(&val, args.as_ref(), &mut errors); + assert_eq!( + &value, + expected_value, + "Values don't match in {}", + scope.get_path() + ); + test_errors(&errors, Some(&assert.errors)); + } else { + panic!("Value field expected."); + } + } + } +} + +fn test_errors(errors: &[FluentError], reference: Option<&[TestError]>) { + let reference = reference.unwrap_or(&[]); + assert_eq!(errors.len(), reference.len()); + for (error, reference) in errors.into_iter().zip(reference) { + match error { + FluentError::ResolverError(err) => match err { + ResolverError::Reference(desc) => { + assert_eq!(reference.desc.as_ref(), Some(desc)); + assert_eq!(reference.error_type, "Reference"); + } + ResolverError::Cyclic => { + assert_eq!(reference.error_type, "Cyclic"); + } + ResolverError::TooManyPlaceables => { + assert_eq!(reference.error_type, "TooManyPlaceables"); + } + _ => unimplemented!(), + }, + FluentError::ParserError(_) => { + assert_eq!(reference.error_type, "Parser"); + } + FluentError::Overriding { .. } => { + assert_eq!(reference.error_type, "Overriding"); + } + } + } +} + +#[test] +fn resolve_fixtures() { + let dir = "./tests/fixtures/"; + let mut defaults_path = String::from(dir); + defaults_path.push_str("defaults.yaml"); + let defaults = if Path::new(&defaults_path).exists() { + Some(get_defaults(&defaults_path).expect("Failed to read defaults.")) + } else { + None + }; + for entry in fs::read_dir(dir).expect("Failed to read glob pattern.") { + let entry = entry.expect("Entry doesn't exist."); + let path = entry.path(); + let path_str = path.to_str().expect("Failed to convert path to string."); + if path_str.contains("defaults.yaml") { + continue; + } + println!("PATH: {:#?}", path_str); + let fixture = get_fixture(path_str).expect("Loading fixture failed."); + + test_fixture(&fixture, &defaults); + } +} diff --git a/third_party/rust/fluent-bundle/tests/types_test.rs b/third_party/rust/fluent-bundle/tests/types_test.rs new file mode 100644 index 000000000000..538daadd8e8c --- /dev/null +++ b/third_party/rust/fluent-bundle/tests/types_test.rs @@ -0,0 +1,156 @@ +use fluent_bundle::resolve::Scope; +use fluent_bundle::types::{ + FluentNumber, FluentNumberCurrencyDisplayStyle, FluentNumberOptions, FluentNumberStyle, +}; +use fluent_bundle::FluentArgs; +use fluent_bundle::FluentBundle; +use fluent_bundle::FluentResource; +use fluent_bundle::FluentValue; +use intl_pluralrules::operands::PluralOperands; +use unic_langid::langid; + +#[test] +fn fluent_value_try_number() { + let value = FluentValue::try_number("invalid"); + assert_eq!(value, "invalid".into()); +} + +#[test] +fn fluent_value_matches() { + // We'll use `ars` locale since it happens to have all + // plural rules categories. + let langid_ars = langid!("ars"); + let bundle: FluentBundle = FluentBundle::new(&[langid_ars]); + let scope = Scope::new(&bundle, None); + + let string_val = FluentValue::from("string1"); + let string_val_copy = FluentValue::from("string1"); + let string_val2 = FluentValue::from("23.5"); + + let number_val = FluentValue::from(-23.5); + let number_val_copy = FluentValue::from(-23.5); + let number_val2 = FluentValue::from(23.5); + + assert_eq!(string_val.matches(&string_val_copy, &scope), true); + assert_eq!(string_val.matches(&string_val2, &scope), false); + + assert_eq!(number_val.matches(&number_val_copy, &scope), true); + assert_eq!(number_val.matches(&number_val2, &scope), false); + + assert_eq!(string_val2.matches(&number_val2, &scope), false); + + assert_eq!(string_val2.matches(&number_val2, &scope), false); + + let string_cat_zero = FluentValue::from("zero"); + let string_cat_one = FluentValue::from("one"); + let string_cat_two = FluentValue::from("two"); + let string_cat_few = FluentValue::from("few"); + let string_cat_many = FluentValue::from("many"); + let string_cat_other = FluentValue::from("other"); + + let number_cat_zero = 0.into(); + let number_cat_one = 1.into(); + let number_cat_two = 2.into(); + let number_cat_few = 3.into(); + let number_cat_many = 11.into(); + let number_cat_other = 101.into(); + + assert_eq!(string_cat_zero.matches(&number_cat_zero, &scope), true); + assert_eq!(string_cat_one.matches(&number_cat_one, &scope), true); + assert_eq!(string_cat_two.matches(&number_cat_two, &scope), true); + assert_eq!(string_cat_few.matches(&number_cat_few, &scope), true); + assert_eq!(string_cat_many.matches(&number_cat_many, &scope), true); + assert_eq!(string_cat_other.matches(&number_cat_other, &scope), true); + assert_eq!(string_cat_other.matches(&number_cat_one, &scope), false); + + assert_eq!(string_val2.matches(&number_cat_one, &scope), false); +} + +#[test] +fn fluent_value_from() { + let value_str = FluentValue::from("my str"); + let value_string = FluentValue::from(String::from("my string")); + let value_f64 = FluentValue::from(23.5); + let value_isize = FluentValue::from(-23); + + assert_eq!(value_str, "my str".into()); + assert_eq!(value_string, "my string".into()); + + assert_eq!(value_f64, FluentValue::from(23.5)); + assert_eq!(value_isize, FluentValue::from(-23)); +} + +#[test] +fn fluent_number_style() { + let fns_decimal: FluentNumberStyle = "decimal".into(); + let fns_currency: FluentNumberStyle = "currency".into(); + let fns_percent: FluentNumberStyle = "percent".into(); + let fns_decimal2: FluentNumberStyle = "other".into(); + assert_eq!(fns_decimal, FluentNumberStyle::Decimal); + assert_eq!(fns_currency, FluentNumberStyle::Currency); + assert_eq!(fns_percent, FluentNumberStyle::Percent); + assert_eq!(fns_decimal2, FluentNumberStyle::Decimal); + + let fncds_symbol: FluentNumberCurrencyDisplayStyle = "symbol".into(); + let fncds_code: FluentNumberCurrencyDisplayStyle = "code".into(); + let fncds_name: FluentNumberCurrencyDisplayStyle = "name".into(); + let fncds_symbol2: FluentNumberCurrencyDisplayStyle = "other".into(); + + assert_eq!(fncds_symbol, FluentNumberCurrencyDisplayStyle::Symbol); + assert_eq!(fncds_code, FluentNumberCurrencyDisplayStyle::Code); + assert_eq!(fncds_name, FluentNumberCurrencyDisplayStyle::Name); + assert_eq!(fncds_symbol2, FluentNumberCurrencyDisplayStyle::Symbol); + + let mut fno = FluentNumberOptions::default(); + + let mut args = FluentArgs::new(); + args.insert("style", "currency".into()); + args.insert("currency", "EUR".into()); + args.insert("currencyDisplay", "code".into()); + args.insert("useGrouping", "true".into()); + args.insert("minimumIntegerDigits", 3.into()); + args.insert("minimumFractionDigits", 3.into()); + args.insert("maximumFractionDigits", 8.into()); + args.insert("minimumSignificantDigits", 1.into()); + args.insert("maximumSignificantDigits", 10.into()); + args.insert("someRandomOption", 10.into()); + + fno.merge(&args); + + assert_eq!(fno.style, FluentNumberStyle::Currency); + assert_eq!(fno.currency, Some("EUR".to_string())); + assert_eq!(fno.currency_display, FluentNumberCurrencyDisplayStyle::Code); + assert_eq!(fno.use_grouping, true); + + let num = FluentNumber::new(0.2, FluentNumberOptions::default()); + assert_eq!(num.as_string(), "0.2"); + + let opts = FluentNumberOptions { + minimum_fraction_digits: Some(3), + ..Default::default() + }; + + let num = FluentNumber::new(0.2, opts.clone()); + assert_eq!(num.as_string(), "0.200"); + + let num = FluentNumber::new(2.0, opts.clone()); + assert_eq!(num.as_string(), "2.000"); +} + +#[test] +fn fluent_number_to_operands() { + let num = FluentNumber::new(2.81, FluentNumberOptions::default()); + let operands: PluralOperands = (&num).into(); + + assert_eq!( + operands, + PluralOperands { + n: 2.81, + i: 2, + v: 2, + w: 2, + f: 81, + t: 81, + } + ); +} diff --git a/third_party/rust/fluent-langneg/.cargo-checksum.json b/third_party/rust/fluent-langneg/.cargo-checksum.json index bf0abede56ec..5dd014fcf449 100644 --- a/third_party/rust/fluent-langneg/.cargo-checksum.json +++ b/third_party/rust/fluent-langneg/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"1b11d8d30fe978704012e27981f8d50a3462319594b54ed2e71eaf85284d61eb","README.md":"a4f17c795725dcb84cdf1e327a61306e82aaa2ca1908c9ea95c0fbe9d53216fd","benches/negotiate.rs":"f14c49d75413fb4b248f8f586c046340d61f0682eb0860db326f1f415e1bceb9","src/accepted_languages.rs":"74fe73bb8c3f36d3b8b85bfdc55731c234c20e92245b0f89eb1e8b68af47c17c","src/lib.rs":"529e3c9810688c3a5d216c977b968a775f83a85c2da90d669f2cfc5eb6c71361","src/negotiate/likely_subtags.rs":"44531e2bbf3a2155771f197f863dffdce403d3e8dd0e1d4f36f7178e52e5a3a3","src/negotiate/mod.rs":"e8aa5ecf08b866d83c957230586cb9c03880473406d7cca28cadf9e883310a15"},"package":"2c4ad0989667548f06ccd0e306ed56b61bd4d35458d54df5ec7587c0e8ed5e94"} \ No newline at end of file +{"files":{"CHANGELOG.md":"3046888911be793996b56111f1f442a04bac633a8a46a550dc36119e796dd32e","Cargo.lock":"751fc08eafcecddbde11a13249ad0692436c5ef8700a7329319e6af4a386d804","Cargo.toml":"f386505f0fae9a28212fe75a8f69866742b42a9ec8573a05bba0db4c291223a1","LICENSE":"b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1","README.md":"a4f17c795725dcb84cdf1e327a61306e82aaa2ca1908c9ea95c0fbe9d53216fd","benches/negotiate.rs":"f14c49d75413fb4b248f8f586c046340d61f0682eb0860db326f1f415e1bceb9","examples/negotiate.rs":"89b561ad4626ff55c3df989f1e87f45126664924ad43f0ff64097bdafc3d52b7","src/accepted_languages.rs":"74fe73bb8c3f36d3b8b85bfdc55731c234c20e92245b0f89eb1e8b68af47c17c","src/lib.rs":"529e3c9810688c3a5d216c977b968a775f83a85c2da90d669f2cfc5eb6c71361","src/negotiate/likely_subtags.rs":"edd5e2d7412a4cc0d36e096cadddac1976c274d74cda532d833d7de1615fde06","src/negotiate/mod.rs":"cc1e17a399e2279fc07e1b949b812635a33216c7012afbc17b3fcfc1eaf02c6c","tests/fixtures/accepted_languages.json":"f33af32d59335b48cbb190af07000c8dbcd7e5c536b91a727fabab5e1c1047b7","tests/fixtures/locale/options-ext.json":"8b022fe4c7ed2e202235e7bf67efae845732f01dda33177511908db629deca66","tests/fixtures/locale/options.json":"aef3c957435512a3d6b0f47530e30539abdead4de5f0a1241fc3a79cd7adf4b7","tests/fixtures/locale/parsing-ext.json":"222c898e6ee55106f34ff65aea5399f4a67b099466c7d678dcde57a3fbf6aaa5","tests/fixtures/locale/parsing.json":"81b718622d0abd608a4a8952cc61ba47451149f671a08cb49105be91d3858f1f","tests/fixtures/locale/serialize-options.json":"f01a9dc00d46619d79958fe47bafcacb9a3fc4a99c3269bc84d6ec5935daa0c4","tests/fixtures/negotiate/filtering/available-as-range.json":"1c3ef674409052a5aab2ff1c3f53a87b601599a2d6654adb3a44a0b94d8a6ac6","tests/fixtures/negotiate/filtering/cases.json":"b94fff9842e6352f6189d0f8d384a95b078fb31a74a09935b8c8fcd8b09cf465","tests/fixtures/negotiate/filtering/cross-region.json":"944d4817cedbfad69ab014e99dee74bedcaf34f1b95256358b231a3f9d53b1c6","tests/fixtures/negotiate/filtering/cross-variant.json":"231f51da8c3271964724ecf06c70205af52bed4caceb1e377f0a0eed947aa7b2","tests/fixtures/negotiate/filtering/default-locale.json":"413492ebd506da173735460523122a695e20987f8ebbd51993d97ae6a1082b0c","tests/fixtures/negotiate/filtering/errors.json":"87a365f866e67076f78351d96d12671cc2ca5f61644e89efe43daf1cbc7a72ed","tests/fixtures/negotiate/filtering/exact-match.json":"de9b59e73c7ea77f5bc5e971f20fc494b29cf2752228754c3945f101f047ffaf","tests/fixtures/negotiate/filtering/likely-subtag.json":"734c37080d3acbc776e07a9aa59b93ec08a44c8e3b715e1177ce0707a5f46c8b","tests/fixtures/negotiate/filtering/prioritize.json":"f6a44e5b1938686dd8f470a6448db86c3075a8331d7e3bfe115456f46f67eee8","tests/fixtures/negotiate/filtering/requested-und.json":"fba7c30e2fb42a303370a2e40c35723b49b50f2c4f6239a01ac84f783a4a46f7","tests/fixtures/negotiate/lookup/main.json":"2ab3ba1fa1e3fea05d3b3de8ee6b8fef9d8c77d4db69a5c99f580ffd4237727b","tests/fixtures/negotiate/matching/main.json":"30beb916aad0d265265dad73222fc6d680d429d22c4b69ebe2b3f08cdb04aade","tests/lib.rs":"4e9112225009cd0619aa0f02b47bfa84e8a708b6501e19994a67a6d9e94f6d23"},"package":"fe5815efd5542e40841cd34ef9003822352b04c67a70c595c6758597c72e1f56"} \ No newline at end of file diff --git a/third_party/rust/fluent-langneg/CHANGELOG.md b/third_party/rust/fluent-langneg/CHANGELOG.md new file mode 100644 index 000000000000..82fa38d6b78b --- /dev/null +++ b/third_party/rust/fluent-langneg/CHANGELOG.md @@ -0,0 +1,72 @@ +# Changelog + +## Unreleased + + - … + +## fluent-langneg 0.12.1 (January 29, 2020) + + - Fixing `maximize` calls in negotiation. + +## fluent-langneg 0.12.0 (January 28, 2020) + + - Update `unic-langid` to 0.8. + +## fluent-langneg 0.11.1 (November 17, 2019) + + - Improve handling of `und` in requested to match Unicode TR35. + +## fluent-langneg 0.11.0 (November 7, 2019) + + - Change name to `fluent-langneg` to better reflect the purpose. + - Update to `unic-langid` 0.7. + - Include feature "cldr" to use full CLDR likely-subtags. + - Improved performance by 50% in the default case, and by further 34% when using CLDR feature. + - Accept `AsRef<[u8]>` instead of `AsRef`. + +## fluent-locale 0.10.0 (October 3, 2019) + + - Update to `unic-langid` 0.6. + +## fluent-locale 0.9.0 (October 1, 2019) + + - Use AsRef as bounds in negotiation. + - Support unic-langid with full CLDR backed likelysubtags behind "cldr" feature. + +## fluent-locale 0.8.0 (September 10, 2019) + + - Update to `unic-langid` 0.5. + +## fluent-locale 0.7.0 (July 30, 2019) + + - Update `unic-langid` to 0.4. + - Switch benchmark to criterion. + - Update helper functions to be more generic. + +## fluent-locale 0.6.0 (July 24, 2019) + + - Switch to use `unic-langid` (but allow for `unic-locale`). + - Refactor the API to handle fallible lists. + +## fluent-locale 0.5.0 (June 16, 2019) + + - Separate out `unic-langid` and `unic-locale` into new crates. + - Switch from BCP47 conformance to Unicode Locale Identifier. + - Update to Rust 2018. + +## fluent-locale 0.4.1 (August 6, 2018) + + - Separate out requested from available to allow for different mixes of Vec and &[]. + +## fluent-locale 0.4.0 (August 6, 2018) + + - Ergonomics improvement - `negotiate_languages` now accepts &[&str], &[String], Vec<&str> and Vec + +## fluent-locale 0.3.2 (July 31, 2018) + + - Make Locale::matches reject matches if privateuse is not empty + +## fluent-locale 0.3.1 (February 12, 2018) + + - Make fluent-locale compliant with rust stable (from 1.23) + diff --git a/third_party/rust/fluent-langneg/Cargo.lock b/third_party/rust/fluent-langneg/Cargo.lock new file mode 100644 index 000000000000..c8b684f5e557 --- /dev/null +++ b/third_party/rust/fluent-langneg/Cargo.lock @@ -0,0 +1,629 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bstr" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "byteorder" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cast" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "clap" +version = "2.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "criterion" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion-plot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "csv 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_os 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_xoshiro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", + "tinytemplate 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "criterion-plot" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "csv" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bstr 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "csv-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "csv-core" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "either" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fluent-langneg" +version = "0.12.1" +dependencies = [ + "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", + "unic-langid 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unic-locale 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "getrandom" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hermit-abi" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itertools" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itoa" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.66" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memchr" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "memoffset" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-traits" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num_cpus" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_os" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_xoshiro" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon-core" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-automata" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ryu" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "scopeguard" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_derive" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_json" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tinystr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "tinytemplate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unic-langid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unic-langid-impl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unic-langid-macros 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unic-langid-impl" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "tinystr 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unic-langid-macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tinystr 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unic-langid-impl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unic-langid-macros-impl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unic-langid-macros-impl" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "unic-langid-impl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unic-locale" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unic-langid-impl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unic-locale-impl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unic-locale-macros 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unic-locale-impl" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "tinystr 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unic-langid-impl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unic-locale-macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tinystr 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unic-locale-impl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unic-locale-macros-impl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unic-locale-macros-impl" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "unic-locale-impl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "walkdir" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +"checksum bstr 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3ede750122d9d1f87919570cb2cccee38c84fbc8c5599b25c289af40625b7030" +"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" +"checksum cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" +"checksum criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "938703e165481c8d612ea3479ac8342e5615185db37765162e762ec3523e2fc6" +"checksum criterion-plot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eccdc6ce8bbe352ca89025bee672aa6d24f4eb8c53e3a8b5d1bc58011da072a2" +"checksum crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" +"checksum crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" +"checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" +"checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" +"checksum csv 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "11f8cbd084b9a431d52dfac0b8428a26b68f1061138a7bea18aa56b9cdf55266" +"checksum csv-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9b5cadb6b25c77aeff80ba701712494213f4a8418fcda2ee11b6560c3ad0bf4c" +"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +"checksum hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eff2656d88f158ce120947499e971d743c05dbcbed62e5bd2f38f1698bbc3772" +"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" +"checksum memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3197e20c7edb283f87c071ddfc7a2cca8f8e0b888c242959846a6fce03c72223" +"checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" +"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +"checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" +"checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" +"checksum proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0319972dcae462681daf4da1adeeaa066e3ebd29c69be96c6abb1259d2ee2bcc" +"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" +"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +"checksum rand_os 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a788ae3edb696cfcba1c19bfd388cc4b8c21f8a408432b199c072825084da58a" +"checksum rand_xoshiro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0e18c91676f670f6f0312764c759405f13afb98d5d73819840cf72a518487bff" +"checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" +"checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" +"checksum regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "92b73c2a1770c255c240eaa4ee600df1704a38dc3feaa6e949e7fcd4f8dc09f9" +"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" +"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" +"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" +"checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" +"checksum serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)" = "48c575e0cc52bdd09b47f330f646cf59afc586e9c4e3ccd6fc1f625b8ea1dad7" +"checksum syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1e4ff033220a41d1a57d8125eab57bf5263783dfdcc18688b1dacc6ce9651ef8" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum tinystr 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4bac79c4b51eda1b090b1edebfb667821bbb51f713855164dc7cec2cb8ac2ba3" +"checksum tinytemplate 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "57a3c6667d3e65eb1bc3aed6fd14011c6cbc3a0665218ab7f5daf040b9ec371a" +"checksum unic-langid 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24d81136159f779c35b10655f45210c71cd5ca5a45aadfe9840a61c7071735ed" +"checksum unic-langid-impl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c43c61e94492eb67f20facc7b025778a904de83d953d8fcb60dd9adfd6e2d0ea" +"checksum unic-langid-macros 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49bd90791278634d57e3ed4a4073108e3f79bfb87ab6a7b8664ba097425703df" +"checksum unic-langid-macros-impl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e0098f77bd754f8fb7850cdf4ab143aa821898c4ac6dc16bcb2aa3e62ce858d1" +"checksum unic-locale 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a0d6e6175e3f8e6d8ba39844a385724fd8b7f4218c783e671c43aaa43526c07" +"checksum unic-locale-impl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fe59350daadc2c23e7acec57cf47200187dbf3116819c9d5471d77384f789e93" +"checksum unic-locale-macros 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "03d300f3892f575a0b7de431f23762c939b38534cd7e11f1cda5966e18ce2e24" +"checksum unic-locale-macros-impl 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "057bc3abf9dde0b89cf418d5a01596f709a3ecbf94609679042343d655583998" +"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" +"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/third_party/rust/fluent-langneg/Cargo.toml b/third_party/rust/fluent-langneg/Cargo.toml index 58aae3c67262..ecbf07e9f66d 100644 --- a/third_party/rust/fluent-langneg/Cargo.toml +++ b/third_party/rust/fluent-langneg/Cargo.toml @@ -13,9 +13,8 @@ [package] edition = "2018" name = "fluent-langneg" -version = "0.13.0" +version = "0.12.1" authors = ["Zibi Braniecki "] -include = ["src/**/*", "benches/*.rs", "Cargo.toml", "README.md"] description = "A library for language and locale negotiation.\n" homepage = "http://projectfluent.org/" readme = "README.md" @@ -27,7 +26,7 @@ repository = "https://github.com/projectfluent/fluent-langneg-rs" name = "negotiate" harness = false [dependencies.unic-langid] -version = "0.9" +version = "0.8" [dev-dependencies.criterion] version = "0.3" @@ -39,11 +38,11 @@ features = ["derive"] version = "1.0" [dev-dependencies.unic-langid] -version = "0.9" +version = "0.8" features = ["macros"] [dev-dependencies.unic-locale] -version = "0.9" +version = "0.8" features = ["macros"] [features] diff --git a/third_party/rust/fluent-langneg/LICENSE b/third_party/rust/fluent-langneg/LICENSE new file mode 100644 index 000000000000..8dada3edaf50 --- /dev/null +++ b/third_party/rust/fluent-langneg/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/third_party/rust/fluent-langneg/examples/negotiate.rs b/third_party/rust/fluent-langneg/examples/negotiate.rs new file mode 100644 index 000000000000..5042ad25ccfa --- /dev/null +++ b/third_party/rust/fluent-langneg/examples/negotiate.rs @@ -0,0 +1,11 @@ +use fluent_langneg::negotiate::NegotiationStrategy; +use fluent_langneg::{convert_vec_str_to_langids_lossy, negotiate_languages}; + +fn main() { + let requested = convert_vec_str_to_langids_lossy(&["it", "pl", "ru"]); + let available = convert_vec_str_to_langids_lossy(&["fr", "en-GB", "en-US", "ru", "pl"]); + let supported = + negotiate_languages(&requested, &available, None, NegotiationStrategy::Filtering); + + println!("{:?}", supported); +} diff --git a/third_party/rust/fluent-langneg/src/negotiate/likely_subtags.rs b/third_party/rust/fluent-langneg/src/negotiate/likely_subtags.rs index 60a7b7a52572..044d1a1f0369 100644 --- a/third_party/rust/fluent-langneg/src/negotiate/likely_subtags.rs +++ b/third_party/rust/fluent-langneg/src/negotiate/likely_subtags.rs @@ -19,11 +19,11 @@ impl MockLikelySubtags for LanguageIdentifier { "zh-GB" => "zh-Hant-GB", "zh-US" => "zh-Hant-US", _ => { - let lang = self.language; + let lang = self.language(); for subtag in REGION_MATCHING_KEYS { if lang == *subtag { - self.region = Some(subtag.parse().unwrap()); + self.set_region(subtag).unwrap(); return true; } } @@ -31,9 +31,17 @@ impl MockLikelySubtags for LanguageIdentifier { } }; let langid: LanguageIdentifier = extended.parse().expect("Failed to parse langid."); - self.language = langid.language; - self.script = langid.script; - self.region = langid.region; + self.set_language(langid.language()).unwrap(); + if let Some(subtag) = langid.script() { + self.set_script(subtag).unwrap(); + } else { + self.clear_script(); + } + if let Some(subtag) = langid.region() { + self.set_region(subtag).unwrap(); + } else { + self.clear_region(); + } true } } diff --git a/third_party/rust/fluent-langneg/src/negotiate/mod.rs b/third_party/rust/fluent-langneg/src/negotiate/mod.rs index 4b3587fd40f0..803d6e00a9ea 100644 --- a/third_party/rust/fluent-langneg/src/negotiate/mod.rs +++ b/third_party/rust/fluent-langneg/src/negotiate/mod.rs @@ -181,7 +181,7 @@ pub fn filter_matches<'a, R: 'a + AsRef, A: 'a + AsRef, A: 'a + AsRef, Vec), + Default(Vec, Vec, String), +} + +#[derive(Serialize, Deserialize)] +struct NegotiateTestSet { + input: NegotiateTestInput, + strategy: Option, + output: Vec, +} + +#[derive(Serialize, Deserialize)] +struct AcceptedLanguagesTestSet { + input: String, + output: Vec, +} + +fn read_negotiate_testsets>( + path: P, +) -> Result, Box> { + let file = File::open(path)?; + let sets = serde_json::from_reader(file)?; + Ok(sets) +} + +fn test_negotiate_fixtures(path: &str) { + println!("Testing path: {}", path); + let tests = read_negotiate_testsets(path).unwrap(); + + for test in tests { + let strategy = match test.strategy { + Some(strategy) => match strategy.as_str() { + "filtering" => NegotiationStrategy::Filtering, + "matching" => NegotiationStrategy::Matching, + "lookup" => NegotiationStrategy::Lookup, + _ => NegotiationStrategy::Filtering, + }, + _ => NegotiationStrategy::Filtering, + }; + match test.input { + NegotiateTestInput::NoDefault(requested, available) => { + let requested = convert_vec_str_to_langids_lossy(requested); + let available = convert_vec_str_to_langids_lossy(available); + let output = convert_vec_str_to_langids_lossy(test.output); + let output2: Vec<&LanguageIdentifier> = output.iter().collect(); + assert_eq!( + negotiate_languages(&requested, &available, None, strategy), + output2, + "Test in {} failed", + path + ); + } + NegotiateTestInput::Default(requested, available, default) => { + let requested = convert_vec_str_to_langids_lossy(requested); + let available = convert_vec_str_to_langids_lossy(available); + let output = convert_vec_str_to_langids_lossy(test.output); + let output2: Vec<&LanguageIdentifier> = output.iter().collect(); + assert_eq!( + negotiate_languages( + &requested, + &available, + default.parse().ok().as_ref(), + strategy + ), + output2, + "Test in {} failed", + path + ); + } + } + } +} + +#[test] +fn negotiate_filtering() { + let paths = fs::read_dir("./tests/fixtures/negotiate/filtering").unwrap(); + + for path in paths { + let p = path.unwrap().path().to_str().unwrap().to_owned(); + test_negotiate_fixtures(p.as_str()); + } +} + +#[test] +fn negotiate_matching() { + let paths = fs::read_dir("./tests/fixtures/negotiate/matching").unwrap(); + + for path in paths { + let p = path.unwrap().path().to_str().unwrap().to_owned(); + test_negotiate_fixtures(p.as_str()); + } +} + +#[test] +fn negotiate_lookup() { + let paths = fs::read_dir("./tests/fixtures/negotiate/lookup").unwrap(); + + for path in paths { + let p = path.unwrap().path().to_str().unwrap().to_owned(); + test_negotiate_fixtures(p.as_str()); + } +} + +#[test] +fn accepted_languages() { + let file = File::open("./tests/fixtures/accepted_languages.json").unwrap(); + let tests: Vec = serde_json::from_reader(file).unwrap(); + + for test in tests { + let locales = parse_accepted_languages(test.input.as_str()); + let output = convert_vec_str_to_langids_lossy(test.output); + assert_eq!(output, locales); + } +} + +#[test] +fn langid_matching() { + let langid_en_us = langid!("en-US"); + let langid_de_at = langid!("de-AT"); + let langid_en = langid!("en"); + let langid_de = langid!("de"); + let langid_pl = langid!("pl"); + + let requested = &[&langid_en_us, &langid_de_at]; + let available = &[&langid_pl, &langid_de, &langid_en]; + assert_eq!( + negotiate_languages(requested, available, None, NegotiationStrategy::Matching), + &[&&langid_en, &&langid_de], + ); + + let requested = &[langid_en_us, langid_de_at]; + let available = &[langid_pl, langid_de.clone(), langid_en.clone()]; + assert_eq!( + negotiate_languages(requested, available, None, NegotiationStrategy::Matching), + &[&langid_en, &langid_de], + ); +} + +#[test] +fn cldr_feature() { + // In this case, the full likelySubtags algorithm knows that `mn` -> `mn-Cyrl`, but + // the mock doesn't. + #[cfg(feature = "cldr")] + assert_eq!( + negotiate_languages( + &[langid!("mn")], + &[langid!("mn-Latn"), langid!("mn-Cyrl")], + None, + NegotiationStrategy::Filtering + ), + &[&langid!("mn-Cyrl")] + ); + + // In result, the mock will just return both in undefined + // order. + #[cfg(not(feature = "cldr"))] + assert_eq!( + negotiate_languages( + &[langid!("mn")], + &[langid!("mn-Latn"), langid!("mn-Cyrl")], + None, + NegotiationStrategy::Filtering + ) + .len(), + 2 + ); +} + +#[test] +fn locale_matching() { + let loc_en_us = locale!("en-US-u-hc-h12"); + let loc_de_at = locale!("de-AT-u-hc-h24"); + let loc_en = locale!("en-u-ca-buddhist"); + let loc_de = locale!("de"); + let loc_pl = locale!("pl-x-private"); + + assert_eq!( + negotiate_languages( + &[&loc_en_us, &loc_de_at], + &[&loc_pl, &loc_de, &loc_en], + None, + NegotiationStrategy::Matching + ), + &[&&loc_en, &&loc_de], + ); + + assert_eq!( + negotiate_languages( + &[loc_en_us, loc_de_at], + &[loc_pl, loc_de.clone(), loc_en.clone()], + None, + NegotiationStrategy::Matching + ), + &[&loc_en, &loc_de], + ); +} diff --git a/third_party/rust/fluent/.cargo-checksum.json b/third_party/rust/fluent/.cargo-checksum.json index afdd4ec2e3aa..79dbd2f732ba 100644 --- a/third_party/rust/fluent/.cargo-checksum.json +++ b/third_party/rust/fluent/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"b7785030a8090bb0e4e93f68248b0748530e190f0a6e8440c756ce85baf4aeaa","README.md":"38ca7cc14db1eb9cce03d8690e9476eaf75e0ed07ae65c68af4573a043c75c34","src/lib.rs":"fbf2afed5ccd9a64f07539e1fca2fb9bf1d96794975927b3a958ec44becbfec6"},"package":"3c3b6132d1377d8776409a337c6851d342aee4e85277c96ecd2755c4e0efde1d"} \ No newline at end of file +{"files":{"CHANGELOG.md":"4ec2cdb8887c88d6b4c9ef7cbd1aaf1484b576611e4378c3204b29549df00e87","Cargo.toml":"a1a18e0d3c6cbd2fe76add7d83a2958a07eba72d1dee17450d19d3ae3bf4a303","README.md":"38ca7cc14db1eb9cce03d8690e9476eaf75e0ed07ae65c68af4573a043c75c34","src/lib.rs":"fbf2afed5ccd9a64f07539e1fca2fb9bf1d96794975927b3a958ec44becbfec6","tests/macro.rs":"1bcdd5c02e12081109237bbf684aef59dc730b01b9cc3abec38a3d95da21adc1","tests/pseudo.rs":"a947580a389cf1ce55dd8dc9931472f4cbba60c6562e557dc531d9010f6f2523"},"package":"9ebe7532e1e5146a909de9e019e31835a84b5dee3eeb234561e525844f3cf3bf"} \ No newline at end of file diff --git a/third_party/rust/fluent/CHANGELOG.md b/third_party/rust/fluent/CHANGELOG.md new file mode 100644 index 000000000000..d84b492c0e01 --- /dev/null +++ b/third_party/rust/fluent/CHANGELOG.md @@ -0,0 +1,51 @@ +# Changelog + +## Unreleased + + - … + +## fluent 0.11.0 (March 10, 2020) + - Update `fluent-bundle` to 0.11.0. + +## fluent 0.10.2 (February 20, 2020) + - Update `fluent-bundle` to 0.10.2. + +## fluent 0.10.1 (February 15, 2020) + - Update `fluent-bundle` to 0.10.1. + +## fluent 0.10.0 (February 13, 2020) + - Update `fluent-bundle` to 0.10.0. + +## fluent 0.9.1 (December 13, 2019) + - Update `fluent-pseudo` to 0.2.0. + +## fluent 0.9.0 (November 26, 2019) + - Update `fluent-bundle` to 0.9.0. + - Update `fluent-pseudo` to 0.1.0. + - Update `unic-langid` to 0.7.0. + +## fluent 0.8.0 (October 3, 2019) + + - Update `fluent-bundle` to 0.8.0. + +## fluent 0.7.2 (October 1, 2019) + + - Update `fluent-bundle` to 0.7.2. + +## fluent 0.7.1 (August 16, 2019) + + - Fix fluent_args to work with crate's FluentBundle + +## fluent 0.7.0 (August 1, 2019) + + - Update to fluent-bundle 0.7.1 + - Optionally bundle fluent-pseudo 0.0.1 + +## fluent 0.6.0 (March 26, 2019) + + - Update to fluent-bundle 0.6.0 + +## fluent 0.5.0 (January 31, 2019) + + - Moved fluent-bundle to its own package + - Set dependency on fluent-bundle 0.5 diff --git a/third_party/rust/fluent/Cargo.toml b/third_party/rust/fluent/Cargo.toml index 72d0481892fa..7fd2e61ef099 100644 --- a/third_party/rust/fluent/Cargo.toml +++ b/third_party/rust/fluent/Cargo.toml @@ -13,9 +13,8 @@ [package] edition = "2018" name = "fluent" -version = "0.12.0" +version = "0.11.0" authors = ["Zibi Braniecki ", "Staś Małolepszy "] -include = ["src/**/*", "benches/*.rs", "Cargo.toml", "README.md"] description = "A localization system designed to unleash the entire expressive power of\nnatural language translations.\n" homepage = "http://www.projectfluent.org" readme = "README.md" @@ -24,11 +23,11 @@ categories = ["localization", "internationalization"] license = "Apache-2.0/MIT" repository = "https://github.com/projectfluent/fluent-rs" [dependencies.fluent-bundle] -version = "0.12" +version = "0.11" [dependencies.fluent-pseudo] version = "0.2" optional = true [dependencies.unic-langid] -version = "0.9" +version = "0.8" diff --git a/third_party/rust/fluent/tests/macro.rs b/third_party/rust/fluent/tests/macro.rs new file mode 100644 index 000000000000..d362bc8ae569 --- /dev/null +++ b/third_party/rust/fluent/tests/macro.rs @@ -0,0 +1,21 @@ +use fluent::fluent_args; +use fluent::FluentValue; +use std::borrow::Cow; + +#[test] +fn test_fluent_args() { + let args = fluent_args![ + "name" => "John", + "emailCount" => 5, + "customValue" => FluentValue::from("My Value") + ]; + assert_eq!( + args.get("name"), + Some(&FluentValue::String(Cow::Borrowed("John"))) + ); + assert_eq!(args.get("emailCount"), Some(&FluentValue::try_number(5))); + assert_eq!( + args.get("customValue"), + Some(&FluentValue::String(Cow::Borrowed("My Value"))) + ); +} diff --git a/third_party/rust/fluent/tests/pseudo.rs b/third_party/rust/fluent/tests/pseudo.rs new file mode 100644 index 000000000000..2309c501e799 --- /dev/null +++ b/third_party/rust/fluent/tests/pseudo.rs @@ -0,0 +1,34 @@ +#[cfg(feature = "fluent-pseudo")] +#[test] +fn test_pseudo() { + use fluent::{FluentBundle, FluentResource}; + use fluent_pseudo::transform; + use std::borrow::Cow; + + fn transform_wrapper(s: &str) -> Cow { + transform(s, false, true) + } + + let mut bundle = FluentBundle::default(); + + let res = FluentResource::try_new(String::from("key = Hello World")).unwrap(); + bundle.add_resource(res).unwrap(); + + { + let msg = bundle.get_message("key").unwrap(); + let mut errors = vec![]; + let val = bundle.format_pattern(msg.value.unwrap(), None, &mut errors); + + assert_eq!(val, "Hello World"); + } + + bundle.set_transform(Some(transform_wrapper)); + + { + let msg = bundle.get_message("key").unwrap(); + let mut errors = vec![]; + let val = bundle.format_pattern(msg.value.unwrap(), None, &mut errors); + + assert_eq!(val, "Ħḗḗŀŀǿǿ Ẇǿǿřŀḓ"); + } +} diff --git a/third_party/rust/intl-memoizer/.cargo-checksum.json b/third_party/rust/intl-memoizer/.cargo-checksum.json index 4cc58e2eeb12..2a15a7f4cae4 100644 --- a/third_party/rust/intl-memoizer/.cargo-checksum.json +++ b/third_party/rust/intl-memoizer/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"844d2077a77d1b483fcb76035f5e5f0efa4d07f69f0b67a499fce1cb019b393b","README.md":"c7084646fb85a4a7031e31e917ba510a942f6ec9958b440c29754765e8f417b4","src/concurrent.rs":"d52dc59d705f1177b311a32032daef09637867c9cae80718fc5d06c5e0a8463e","src/lib.rs":"9cb0ed0f06699ead0416a70868021c32087c7fe085f64cc73dbac395f4b08fc5"},"package":"8a0ed58ba6089d49f8a9a7d5e16fc9b9e2019cdf40ef270f3d465fa244d9630b"} \ No newline at end of file +{"files":{"CHANGELOG.md":"765f6d311c7605c90dc1e961134c046e3dfb0867611400c77bde1698152b2440","Cargo.lock":"990c1e513ab375643acf72421c3e5a96ef9df8085728bdf14580a93ef1e6a288","Cargo.toml":"8358daa9d239918a5167fd55afac7f6a570883112650461ddc19dd3cdd70a3b3","README.md":"c7084646fb85a4a7031e31e917ba510a942f6ec9958b440c29754765e8f417b4","examples/numberformat.rs":"b4f669df13f45a2bd05704f53ec79840d9532a1e0e9e4cab49ba9e77d4338de3","examples/pluralrules.rs":"778bb55db18e8314429181f6c456cc6a50ab2d0c44ba61825db56ed5e4db3560","src/concurrent.rs":"d52dc59d705f1177b311a32032daef09637867c9cae80718fc5d06c5e0a8463e","src/lib.rs":"9cb0ed0f06699ead0416a70868021c32087c7fe085f64cc73dbac395f4b08fc5"},"package":"9867e2d65d82936ef34217ed0f87b639a94384e93a0676158142c861c705391f"} \ No newline at end of file diff --git a/third_party/rust/intl-memoizer/CHANGELOG.md b/third_party/rust/intl-memoizer/CHANGELOG.md new file mode 100644 index 000000000000..a0563e38c6fa --- /dev/null +++ b/third_party/rust/intl-memoizer/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog + +## Unreleased + + - … + +## intl-memoizer 0.4.0 (March 10, 2020) + - Separate out `concurrent` version of `IntlLangMemoizer`. + +## intl-memoizer 0.3.0 (February 20, 2020) + - Switch to `type_map::concurrent` to allow for Send+Sync. + +## intl-memoizer 0.2.0 (February 13, 2020) + - Initial release. diff --git a/third_party/rust/intl-memoizer/Cargo.lock b/third_party/rust/intl-memoizer/Cargo.lock new file mode 100644 index 000000000000..47c5402d25b6 --- /dev/null +++ b/third_party/rust/intl-memoizer/Cargo.lock @@ -0,0 +1,78 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" + +[[package]] +name = "fluent-langneg" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe5815efd5542e40841cd34ef9003822352b04c67a70c595c6758597c72e1f56" +dependencies = [ + "unic-langid", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "intl-memoizer" +version = "0.4.0" +dependencies = [ + "fluent-langneg", + "intl_pluralrules", + "type-map", + "unic-langid", +] + +[[package]] +name = "intl_pluralrules" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d82c14d8eece42c03353e0ce86a4d3f97b1f1cef401e4d962dca6c6214a85002" +dependencies = [ + "tinystr", + "unic-langid", +] + +[[package]] +name = "tinystr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bac79c4b51eda1b090b1edebfb667821bbb51f713855164dc7cec2cb8ac2ba3" + +[[package]] +name = "type-map" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d2741b1474c327d95c1f1e3b0a2c3977c8e128409c572a33af2914e7d636717" +dependencies = [ + "fxhash", +] + +[[package]] +name = "unic-langid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d81136159f779c35b10655f45210c71cd5ca5a45aadfe9840a61c7071735ed" +dependencies = [ + "unic-langid-impl", +] + +[[package]] +name = "unic-langid-impl" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43c61e94492eb67f20facc7b025778a904de83d953d8fcb60dd9adfd6e2d0ea" +dependencies = [ + "tinystr", +] diff --git a/third_party/rust/intl-memoizer/Cargo.toml b/third_party/rust/intl-memoizer/Cargo.toml index 707bec3ecd78..2d929ce89aab 100644 --- a/third_party/rust/intl-memoizer/Cargo.toml +++ b/third_party/rust/intl-memoizer/Cargo.toml @@ -13,9 +13,8 @@ [package] edition = "2018" name = "intl-memoizer" -version = "0.5.0" +version = "0.4.0" authors = ["Zibi Braniecki ", "Manish Goregaokar "] -include = ["src/**/*", "benches/*.rs", "Cargo.toml", "README.md"] description = "A memoizer specifically tailored for storing lazy-initialized\nintl formatters.\n" homepage = "http://www.projectfluent.org" readme = "README.md" @@ -27,9 +26,9 @@ repository = "https://github.com/projectfluent/fluent-rs" version = "0.3" [dependencies.unic-langid] -version = "0.9" +version = "0.8" [dev-dependencies.fluent-langneg] -version = "0.13" +version = "0.12" [dev-dependencies.intl_pluralrules] -version = "7.0" +version = "6.0" diff --git a/third_party/rust/intl-memoizer/examples/numberformat.rs b/third_party/rust/intl-memoizer/examples/numberformat.rs new file mode 100644 index 000000000000..090acf1c2b83 --- /dev/null +++ b/third_party/rust/intl-memoizer/examples/numberformat.rs @@ -0,0 +1,78 @@ +use intl_memoizer::{IntlMemoizer, Memoizable}; +use unic_langid::LanguageIdentifier; + +#[derive(Clone, Hash, PartialEq, Eq)] +struct NumberFormatOptions { + minimum_fraction_digits: usize, + maximum_fraction_digits: usize, +} + +struct NumberFormat { + lang: LanguageIdentifier, + options: NumberFormatOptions, +} + +impl NumberFormat { + pub fn new(lang: LanguageIdentifier, options: NumberFormatOptions) -> Result { + Ok(Self { lang, options }) + } + + pub fn format(&self, input: isize) -> String { + format!( + "{}: {}, MFD: {}", + self.lang, input, self.options.minimum_fraction_digits + ) + } +} + +impl Memoizable for NumberFormat { + type Args = (NumberFormatOptions,); + type Error = (); + fn construct(lang: LanguageIdentifier, args: Self::Args) -> Result { + Self::new(lang, args.0) + } +} + +fn main() { + let mut memoizer = IntlMemoizer::default(); + + let lang: LanguageIdentifier = "en-US".parse().unwrap(); + { + // Create an en-US memoizer + let lang_memoizer = memoizer.get_for_lang(lang.clone()); + let options = NumberFormatOptions { + minimum_fraction_digits: 3, + maximum_fraction_digits: 5, + }; + let result = lang_memoizer + .with_try_get::((options,), |nf| nf.format(2)) + .unwrap(); + + assert_eq!(&result, "en-US: 2, MFD: 3"); + + // Reuse the same en-US memoizer + let lang_memoizer = memoizer.get_for_lang(lang.clone()); + let options = NumberFormatOptions { + minimum_fraction_digits: 3, + maximum_fraction_digits: 5, + }; + let result = lang_memoizer + .with_try_get::((options,), |nf| nf.format(1)) + .unwrap(); + assert_eq!(&result, "en-US: 1, MFD: 3"); + } + + { + // Here, we will construct a new lang memoizer + let lang_memoizer = memoizer.get_for_lang(lang.clone()); + let options = NumberFormatOptions { + minimum_fraction_digits: 3, + maximum_fraction_digits: 5, + }; + let result = lang_memoizer + .with_try_get::((options,), |nf| nf.format(7)) + .unwrap(); + + assert_eq!(&result, "en-US: 7, MFD: 3"); + } +} diff --git a/third_party/rust/intl-memoizer/examples/pluralrules.rs b/third_party/rust/intl-memoizer/examples/pluralrules.rs new file mode 100644 index 000000000000..bb059e872052 --- /dev/null +++ b/third_party/rust/intl-memoizer/examples/pluralrules.rs @@ -0,0 +1,31 @@ +use intl_memoizer::{IntlMemoizer, Memoizable}; +use intl_pluralrules::{PluralCategory, PluralRuleType, PluralRules as IntlPluralRules}; +use unic_langid::LanguageIdentifier; + +struct PluralRules(pub IntlPluralRules); + +impl PluralRules { + pub fn new(lang: LanguageIdentifier, pr_type: PluralRuleType) -> Result { + Ok(Self(IntlPluralRules::create(lang, pr_type)?)) + } +} + +impl Memoizable for PluralRules { + type Args = (PluralRuleType,); + type Error = &'static str; + fn construct(lang: LanguageIdentifier, args: Self::Args) -> Result { + Self::new(lang, args.0) + } +} + +fn main() { + let mut memoizer = IntlMemoizer::default(); + + let lang: LanguageIdentifier = "en".parse().unwrap(); + let lang_memoizer = memoizer.get_for_lang(lang.clone()); + let result = lang_memoizer + .with_try_get::((PluralRuleType::CARDINAL,), |pr| pr.0.select(5)) + .unwrap(); + + assert_eq!(result, Ok(PluralCategory::OTHER)); +} diff --git a/third_party/rust/intl_pluralrules/.cargo-checksum.json b/third_party/rust/intl_pluralrules/.cargo-checksum.json index d1299a20a729..760b01a1a601 100644 --- a/third_party/rust/intl_pluralrules/.cargo-checksum.json +++ b/third_party/rust/intl_pluralrules/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"fc6b94bccbe543c92858eb40b6538155aa73e85096843bf6b01a38f99c642112","README.md":"4dad9bc033a67101bc318662c055318457f0b91e12fdc0a566495b455ceeb4b8","benches/pluralrules.rs":"9c80009fa94a8dbf31bdba489f320d92a40f482c37149030fbba53cd62b5435f","src/lib.rs":"732bde12e3f83b193bf07fb3528e46decb11d2ce5bb442190df0530b48888013","src/operands.rs":"b58c9f8f0f7ce4622ccc685f08b15ede09591b628deffa3b14abde873d26c44a","src/rules.rs":"7b3f0c12e0722401efbdb54873e8545f943bf4a34cba9f894ead9dc955112aaf"},"package":"6c271cdb1f12a9feb3a017619c3ee681f971f270f6757341d6abe1f9f7a98bc3"} \ No newline at end of file +{"files":{"CHANGELOG.md":"bd3fa43e17933d166cd18e6b6d2017c1450a9a7676f9f1badf18182b068ee14e","Cargo.toml":"766565f9381784df443f5d9886da9697f47c7bbce5fbc62411b329e2b3637f43","README.md":"4dad9bc033a67101bc318662c055318457f0b91e12fdc0a566495b455ceeb4b8","benches/pluralrules.rs":"9c80009fa94a8dbf31bdba489f320d92a40f482c37149030fbba53cd62b5435f","cldr_data/cldr_pluralrules_cardinals.json":"1756d5e4e73343c26a3257597d0d17a5a8fa0d208801ec572c232d792df31f56","cldr_data/cldr_pluralrules_ordinals.json":"35c6573cc59ec1e69e1f0e893e7dbbd32cb59e64717fb16c2e501c80672cc67e","src/lib.rs":"c83aefd97da4cdcc3286173f090c45049669b7ea7a5e06d20b6247de1f1d246c","src/operands.rs":"02461c4820398ff6606e55b3db95571f740c589494cf56f370a650f9828f1eab","src/rules.rs":"de67ce1f8b2ac60aa30e42d07abc986530f51ffa73f6969933c7adf55e85a56e","tests/operands.rs":"ae4274473b1d397104b51c65cb4ebdfa1c84690b06df4c45ecc91b8339c51688"},"package":"d82c14d8eece42c03353e0ce86a4d3f97b1f1cef401e4d962dca6c6214a85002"} \ No newline at end of file diff --git a/third_party/rust/intl_pluralrules/CHANGELOG.md b/third_party/rust/intl_pluralrules/CHANGELOG.md new file mode 100644 index 000000000000..1a89bbb139e6 --- /dev/null +++ b/third_party/rust/intl_pluralrules/CHANGELOG.md @@ -0,0 +1,87 @@ +# Changelog + +## Unreleased + + - … + +## intl_pluralrules 6.0.0 (January 28, 2020) + + - Switch to use `TryFrom`/`TryInto` for `PluralOperands`. + - Update `unic-langid` to 0.8. + - Optimize `PluralOperands` struct memory layout. + +## intl_pluralrules 5.0.2 (December 19, 2019) + + - Make `PluralRuleType` derive `Hash` and `Eq`. + +## intl_pluralrules 5.0.1 (November 20, 2019) + + - The `rules.rs` grew too big, so use macro to shrink it. + +## intl_pluralrules 5.0.0 (November 13, 2019) + + - Renamed `IntlPluralRules` to `PluralRules` in line with + other internationalization naming conventions. + - Use updated generated tables which operate on sorted + vectors of `(LanguageIdentifier, PluralRule)` tuples. + - Improved performance of construction of `PluralRules` by 66%. + - Removed dependency on `phf`. + +## intl_pluralrules 4.0.1 (October 15, 2019) + + - Update CLDR to 36. + +## intl_pluralrules 4.0.0 (October 3, 2019) + + - Upgrade to unic-langid 0.6. + +## intl_pluralrules 3.0.0 (September 10, 2019) + + - Upgrade to unic-langid 0.5. + +## intl_pluralrules 2.0.0 (July 26, 2019) + + - Switch to unic_langid for Language Identifiers. + +## intl_pluralrules 1.0.3 (March 29, 2019) + + - Update CLDR to 35 + +## intl_pluralrules 1.0.2 (January 7, 2019) + + - Update to Rust 2018. + +## intl_pluralrules 1.0.1 (October 26, 2018) + + - Update CLDR to 34 + - Update rules to pass enums by reference + +## intl_pluralrules 1.0.0 (August 15, 2018) + + - Add dedicated impls for PluralOperands::from + - New trait extends impls to custom types + - Other minor optimizations + +## intl_pluralrules 0.9.1 (August 6, 2018) + + - Updates to docs for PluralRuleType. + - Move PluralRuleType from rules.rs to lib.rs. + - Fix lib.rs doc. + +## intl_pluralrules 0.9.0 (August 3, 2018) + + - Updates to docs. + +## intl_pluralrules 0.8.2 (July 31, 2018) + + - Optimization for operands.rs. + +## intl_pluralrules 0.8.1 (July 30, 2018) + + - Locale field. + - Locale field getter function. + - Update rules.rs. + +## intl_pluralrules 0.8.0 (July 30, 2018) + + - Initial release. diff --git a/third_party/rust/intl_pluralrules/Cargo.toml b/third_party/rust/intl_pluralrules/Cargo.toml index a0dc3b54bf9b..0344f2392a73 100644 --- a/third_party/rust/intl_pluralrules/Cargo.toml +++ b/third_party/rust/intl_pluralrules/Cargo.toml @@ -13,9 +13,8 @@ [package] edition = "2018" name = "intl_pluralrules" -version = "7.0.0" +version = "6.0.0" authors = ["Kekoa Riggin ", "Zibi Braniecki "] -include = ["src/**/*", "benches/*.rs", "Cargo.toml", "README.md"] description = "Unicode Plural Rules categorizer for numeric input." readme = "README.md" keywords = ["localization", "l10n", "i18n", "intl", "internationalization"] @@ -30,12 +29,12 @@ harness = false version = "0.3.2" [dependencies.unic-langid] -version = "0.9" +version = "0.8" [dev-dependencies.criterion] version = "0.3" [dev-dependencies.unic-langid] -version = "0.9" +version = "0.8" features = ["macros"] [badges.coveralls] branch = "master" diff --git a/third_party/rust/intl_pluralrules/cldr_data/cldr_pluralrules_cardinals.json b/third_party/rust/intl_pluralrules/cldr_data/cldr_pluralrules_cardinals.json new file mode 100644 index 000000000000..72c759a981f3 --- /dev/null +++ b/third_party/rust/intl_pluralrules/cldr_data/cldr_pluralrules_cardinals.json @@ -0,0 +1,893 @@ +{ + "supplemental": { + "version": { + "_unicodeVersion": "12.1.0", + "_cldrVersion": "36" + }, + "plurals-type-cardinal": { + "af": { + "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, …" + }, + "ak": { + "pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "am": { + "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, …" + }, + "an": { + "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, …" + }, + "ar": { + "pluralRule-count-zero": "n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000", + "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-few": "n % 100 = 3..10 @integer 3~10, 103~110, 1003, … @decimal 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 103.0, 1003.0, …", + "pluralRule-count-many": "n % 100 = 11..99 @integer 11~26, 111, 1011, … @decimal 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 111.0, 1011.0, …", + "pluralRule-count-other": " @integer 100~102, 200~202, 300~302, 400~402, 500~502, 600, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.1, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ars": { + "pluralRule-count-zero": "n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000", + "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-few": "n % 100 = 3..10 @integer 3~10, 103~110, 1003, … @decimal 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 103.0, 1003.0, …", + "pluralRule-count-many": "n % 100 = 11..99 @integer 11~26, 111, 1011, … @decimal 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 111.0, 1011.0, …", + "pluralRule-count-other": " @integer 100~102, 200~202, 300~302, 400~402, 500~502, 600, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.1, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "as": { + "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, …" + }, + "asa": { + "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, …" + }, + "ast": { + "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, …" + }, + "az": { + "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, …" + }, + "be": { + "pluralRule-count-one": "n % 10 = 1 and n % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 1.0, 21.0, 31.0, 41.0, 51.0, 61.0, 71.0, 81.0, 101.0, 1001.0, …", + "pluralRule-count-few": "n % 10 = 2..4 and n % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, … @decimal 2.0, 3.0, 4.0, 22.0, 23.0, 24.0, 32.0, 33.0, 102.0, 1002.0, …", + "pluralRule-count-many": "n % 10 = 0 or n % 10 = 5..9 or n % 100 = 11..14 @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-other": " @decimal 0.1~0.9, 1.1~1.7, 10.1, 100.1, 1000.1, …" + }, + "bem": { + "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, …" + }, + "bez": { + "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, …" + }, + "bg": { + "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, …" + }, + "bho": { + "pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "bm": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "bn": { + "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, …" + }, + "bo": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "br": { + "pluralRule-count-one": "n % 10 = 1 and n % 100 != 11,71,91 @integer 1, 21, 31, 41, 51, 61, 81, 101, 1001, … @decimal 1.0, 21.0, 31.0, 41.0, 51.0, 61.0, 81.0, 101.0, 1001.0, …", + "pluralRule-count-two": "n % 10 = 2 and n % 100 != 12,72,92 @integer 2, 22, 32, 42, 52, 62, 82, 102, 1002, … @decimal 2.0, 22.0, 32.0, 42.0, 52.0, 62.0, 82.0, 102.0, 1002.0, …", + "pluralRule-count-few": "n % 10 = 3..4,9 and n % 100 != 10..19,70..79,90..99 @integer 3, 4, 9, 23, 24, 29, 33, 34, 39, 43, 44, 49, 103, 1003, … @decimal 3.0, 4.0, 9.0, 23.0, 24.0, 29.0, 33.0, 34.0, 103.0, 1003.0, …", + "pluralRule-count-many": "n != 0 and n % 1000000 = 0 @integer 1000000, … @decimal 1000000.0, 1000000.00, 1000000.000, …", + "pluralRule-count-other": " @integer 0, 5~8, 10~20, 100, 1000, 10000, 100000, … @decimal 0.0~0.9, 1.1~1.6, 10.0, 100.0, 1000.0, 10000.0, 100000.0, …" + }, + "brx": { + "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, …" + }, + "bs": { + "pluralRule-count-one": "v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …", + "pluralRule-count-few": "v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, … @decimal 0.2~0.4, 1.2~1.4, 2.2~2.4, 3.2~3.4, 4.2~4.4, 5.2, 10.2, 100.2, 1000.2, …", + "pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 0.5~1.0, 1.5~2.0, 2.5~2.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ca": { + "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, …" + }, + "ce": { + "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, …" + }, + "ceb": { + "pluralRule-count-one": "v = 0 and i = 1,2,3 or v = 0 and i % 10 != 4,6,9 or v != 0 and f % 10 != 4,6,9 @integer 0~3, 5, 7, 8, 10~13, 15, 17, 18, 20, 21, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.3, 0.5, 0.7, 0.8, 1.0~1.3, 1.5, 1.7, 1.8, 2.0, 2.1, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-other": " @integer 4, 6, 9, 14, 16, 19, 24, 26, 104, 1004, … @decimal 0.4, 0.6, 0.9, 1.4, 1.6, 1.9, 2.4, 2.6, 10.4, 100.4, 1000.4, …" + }, + "cgg": { + "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, …" + }, + "chr": { + "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, …" + }, + "ckb": { + "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, …" + }, + "cs": { + "pluralRule-count-one": "i = 1 and v = 0 @integer 1", + "pluralRule-count-few": "i = 2..4 and v = 0 @integer 2~4", + "pluralRule-count-many": "v != 0 @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …" + }, + "cy": { + "pluralRule-count-zero": "n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000", + "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-few": "n = 3 @integer 3 @decimal 3.0, 3.00, 3.000, 3.0000", + "pluralRule-count-many": "n = 6 @integer 6 @decimal 6.0, 6.00, 6.000, 6.0000", + "pluralRule-count-other": " @integer 4, 5, 7~20, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "da": { + "pluralRule-count-one": "n = 1 or t != 0 and i = 0,1 @integer 1 @decimal 0.1~1.6", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 2.0~3.4, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "de": { + "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, …" + }, + "dsb": { + "pluralRule-count-one": "v = 0 and i % 100 = 1 or f % 100 = 1 @integer 1, 101, 201, 301, 401, 501, 601, 701, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …", + "pluralRule-count-two": "v = 0 and i % 100 = 2 or f % 100 = 2 @integer 2, 102, 202, 302, 402, 502, 602, 702, 1002, … @decimal 0.2, 1.2, 2.2, 3.2, 4.2, 5.2, 6.2, 7.2, 10.2, 100.2, 1000.2, …", + "pluralRule-count-few": "v = 0 and i % 100 = 3..4 or f % 100 = 3..4 @integer 3, 4, 103, 104, 203, 204, 303, 304, 403, 404, 503, 504, 603, 604, 703, 704, 1003, … @decimal 0.3, 0.4, 1.3, 1.4, 2.3, 2.4, 3.3, 3.4, 4.3, 4.4, 5.3, 5.4, 6.3, 6.4, 7.3, 7.4, 10.3, 100.3, 1000.3, …", + "pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 0.5~1.0, 1.5~2.0, 2.5~2.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "dv": { + "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, …" + }, + "dz": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ee": { + "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, …" + }, + "el": { + "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, …" + }, + "en": { + "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, …" + }, + "eo": { + "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, …" + }, + "es": { + "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, …" + }, + "et": { + "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, …" + }, + "eu": { + "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, …" + }, + "fa": { + "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, …" + }, + "ff": { + "pluralRule-count-one": "i = 0,1 @integer 0, 1 @decimal 0.0~1.5", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "fi": { + "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, …" + }, + "fil": { + "pluralRule-count-one": "v = 0 and i = 1,2,3 or v = 0 and i % 10 != 4,6,9 or v != 0 and f % 10 != 4,6,9 @integer 0~3, 5, 7, 8, 10~13, 15, 17, 18, 20, 21, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.3, 0.5, 0.7, 0.8, 1.0~1.3, 1.5, 1.7, 1.8, 2.0, 2.1, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-other": " @integer 4, 6, 9, 14, 16, 19, 24, 26, 104, 1004, … @decimal 0.4, 0.6, 0.9, 1.4, 1.6, 1.9, 2.4, 2.6, 10.4, 100.4, 1000.4, …" + }, + "fo": { + "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, …" + }, + "fr": { + "pluralRule-count-one": "i = 0,1 @integer 0, 1 @decimal 0.0~1.5", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "fur": { + "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, …" + }, + "fy": { + "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, …" + }, + "ga": { + "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-few": "n = 3..6 @integer 3~6 @decimal 3.0, 4.0, 5.0, 6.0, 3.00, 4.00, 5.00, 6.00, 3.000, 4.000, 5.000, 6.000, 3.0000, 4.0000, 5.0000, 6.0000", + "pluralRule-count-many": "n = 7..10 @integer 7~10 @decimal 7.0, 8.0, 9.0, 10.0, 7.00, 8.00, 9.00, 10.00, 7.000, 8.000, 9.000, 10.000, 7.0000, 8.0000, 9.0000, 10.0000", + "pluralRule-count-other": " @integer 0, 11~25, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.1, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "gd": { + "pluralRule-count-one": "n = 1,11 @integer 1, 11 @decimal 1.0, 11.0, 1.00, 11.00, 1.000, 11.000, 1.0000", + "pluralRule-count-two": "n = 2,12 @integer 2, 12 @decimal 2.0, 12.0, 2.00, 12.00, 2.000, 12.000, 2.0000", + "pluralRule-count-few": "n = 3..10,13..19 @integer 3~10, 13~19 @decimal 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 3.00", + "pluralRule-count-other": " @integer 0, 20~34, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.9, 1.1~1.6, 10.1, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "gl": { + "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, …" + }, + "gsw": { + "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, …" + }, + "gu": { + "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, …" + }, + "guw": { + "pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "gv": { + "pluralRule-count-one": "v = 0 and i % 10 = 1 @integer 1, 11, 21, 31, 41, 51, 61, 71, 101, 1001, …", + "pluralRule-count-two": "v = 0 and i % 10 = 2 @integer 2, 12, 22, 32, 42, 52, 62, 72, 102, 1002, …", + "pluralRule-count-few": "v = 0 and i % 100 = 0,20,40,60,80 @integer 0, 20, 40, 60, 80, 100, 120, 140, 1000, 10000, 100000, 1000000, …", + "pluralRule-count-many": "v != 0 @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-other": " @integer 3~10, 13~19, 23, 103, 1003, …" + }, + "ha": { + "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, …" + }, + "haw": { + "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, …" + }, + "he": { + "pluralRule-count-one": "i = 1 and v = 0 @integer 1", + "pluralRule-count-two": "i = 2 and v = 0 @integer 2", + "pluralRule-count-many": "v = 0 and n != 0..10 and n % 10 = 0 @integer 20, 30, 40, 50, 60, 70, 80, 90, 100, 1000, 10000, 100000, 1000000, …", + "pluralRule-count-other": " @integer 0, 3~17, 101, 1001, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "hi": { + "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, …" + }, + "hr": { + "pluralRule-count-one": "v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …", + "pluralRule-count-few": "v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, … @decimal 0.2~0.4, 1.2~1.4, 2.2~2.4, 3.2~3.4, 4.2~4.4, 5.2, 10.2, 100.2, 1000.2, …", + "pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 0.5~1.0, 1.5~2.0, 2.5~2.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "hsb": { + "pluralRule-count-one": "v = 0 and i % 100 = 1 or f % 100 = 1 @integer 1, 101, 201, 301, 401, 501, 601, 701, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …", + "pluralRule-count-two": "v = 0 and i % 100 = 2 or f % 100 = 2 @integer 2, 102, 202, 302, 402, 502, 602, 702, 1002, … @decimal 0.2, 1.2, 2.2, 3.2, 4.2, 5.2, 6.2, 7.2, 10.2, 100.2, 1000.2, …", + "pluralRule-count-few": "v = 0 and i % 100 = 3..4 or f % 100 = 3..4 @integer 3, 4, 103, 104, 203, 204, 303, 304, 403, 404, 503, 504, 603, 604, 703, 704, 1003, … @decimal 0.3, 0.4, 1.3, 1.4, 2.3, 2.4, 3.3, 3.4, 4.3, 4.4, 5.3, 5.4, 6.3, 6.4, 7.3, 7.4, 10.3, 100.3, 1000.3, …", + "pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 0.5~1.0, 1.5~2.0, 2.5~2.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "hu": { + "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, …" + }, + "hy": { + "pluralRule-count-one": "i = 0,1 @integer 0, 1 @decimal 0.0~1.5", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ia": { + "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, …" + }, + "id": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ig": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ii": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "in": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "io": { + "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, …" + }, + "is": { + "pluralRule-count-one": "t = 0 and i % 10 = 1 and i % 100 != 11 or t != 0 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1~1.6, 10.1, 100.1, 1000.1, …", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "it": { + "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, …" + }, + "iu": { + "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, …" + }, + "iw": { + "pluralRule-count-one": "i = 1 and v = 0 @integer 1", + "pluralRule-count-two": "i = 2 and v = 0 @integer 2", + "pluralRule-count-many": "v = 0 and n != 0..10 and n % 10 = 0 @integer 20, 30, 40, 50, 60, 70, 80, 90, 100, 1000, 10000, 100000, 1000000, …", + "pluralRule-count-other": " @integer 0, 3~17, 101, 1001, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ja": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "jbo": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "jgo": { + "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, …" + }, + "ji": { + "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, …" + }, + "jmc": { + "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, …" + }, + "jv": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "jw": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ka": { + "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, …" + }, + "kab": { + "pluralRule-count-one": "i = 0,1 @integer 0, 1 @decimal 0.0~1.5", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "kaj": { + "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, …" + }, + "kcg": { + "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, …" + }, + "kde": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "kea": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "kk": { + "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, …" + }, + "kkj": { + "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, …" + }, + "kl": { + "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, …" + }, + "km": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "kn": { + "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, …" + }, + "ko": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ks": { + "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, …" + }, + "ksb": { + "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, …" + }, + "ksh": { + "pluralRule-count-zero": "n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000", + "pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ku": { + "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, …" + }, + "kw": { + "pluralRule-count-zero": "n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000", + "pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", + "pluralRule-count-two": "n % 100 = 2,22,42,62,82 or n % 1000 = 0 and n % 100000 = 1000..20000,40000,60000,80000 or n != 0 and n % 1000000 = 100000 @integer 2, 22, 42, 62, 82, 102, 122, 142, 1000, 10000, 100000, … @decimal 2.0, 22.0, 42.0, 62.0, 82.0, 102.0, 122.0, 142.0, 1000.0, 10000.0, 100000.0, …", + "pluralRule-count-few": "n % 100 = 3,23,43,63,83 @integer 3, 23, 43, 63, 83, 103, 123, 143, 1003, … @decimal 3.0, 23.0, 43.0, 63.0, 83.0, 103.0, 123.0, 143.0, 1003.0, …", + "pluralRule-count-many": "n != 1 and n % 100 = 1,21,41,61,81 @integer 21, 41, 61, 81, 101, 121, 141, 161, 1001, … @decimal 21.0, 41.0, 61.0, 81.0, 101.0, 121.0, 141.0, 161.0, 1001.0, …", + "pluralRule-count-other": " @integer 4~19, 100, 1004, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.1, 1000000.0, …" + }, + "ky": { + "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, …" + }, + "lag": { + "pluralRule-count-zero": "n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000", + "pluralRule-count-one": "i = 0,1 and n != 0 @integer 1 @decimal 0.1~1.6", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "lb": { + "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, …" + }, + "lg": { + "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, …" + }, + "lkt": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ln": { + "pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "lo": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "lt": { + "pluralRule-count-one": "n % 10 = 1 and n % 100 != 11..19 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 1.0, 21.0, 31.0, 41.0, 51.0, 61.0, 71.0, 81.0, 101.0, 1001.0, …", + "pluralRule-count-few": "n % 10 = 2..9 and n % 100 != 11..19 @integer 2~9, 22~29, 102, 1002, … @decimal 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 22.0, 102.0, 1002.0, …", + "pluralRule-count-many": "f != 0 @decimal 0.1~0.9, 1.1~1.7, 10.1, 100.1, 1000.1, …", + "pluralRule-count-other": " @integer 0, 10~20, 30, 40, 50, 60, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "lv": { + "pluralRule-count-zero": "n % 10 = 0 or n % 100 = 11..19 or v = 2 and f % 100 = 11..19 @integer 0, 10~20, 30, 40, 50, 60, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-one": "n % 10 = 1 and n % 100 != 11 or v = 2 and f % 10 = 1 and f % 100 != 11 or v != 2 and f % 10 = 1 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.0, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …", + "pluralRule-count-other": " @integer 2~9, 22~29, 102, 1002, … @decimal 0.2~0.9, 1.2~1.9, 10.2, 100.2, 1000.2, …" + }, + "mas": { + "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, …" + }, + "mg": { + "pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "mgo": { + "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, …" + }, + "mk": { + "pluralRule-count-one": "v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 0.2~1.0, 1.2~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ml": { + "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, …" + }, + "mn": { + "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, …" + }, + "mo": { + "pluralRule-count-one": "i = 1 and v = 0 @integer 1", + "pluralRule-count-few": "v != 0 or n = 0 or n % 100 = 2..19 @integer 0, 2~16, 102, 1002, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-other": " @integer 20~35, 100, 1000, 10000, 100000, 1000000, …" + }, + "mr": { + "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, …" + }, + "ms": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "mt": { + "pluralRule-count-one": "n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000", + "pluralRule-count-few": "n = 0 or n % 100 = 2..10 @integer 0, 2~10, 102~107, 1002, … @decimal 0.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 10.0, 102.0, 1002.0, …", + "pluralRule-count-many": "n % 100 = 11..19 @integer 11~19, 111~117, 1011, … @decimal 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 111.0, 1011.0, …", + "pluralRule-count-other": " @integer 20~35, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.1, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "my": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "nah": { + "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, …" + }, + "naq": { + "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, …" + }, + "nb": { + "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, …" + }, + "nd": { + "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, …" + }, + "ne": { + "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, …" + }, + "nl": { + "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, …" + }, + "nn": { + "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, …" + }, + "nnh": { + "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, …" + }, + "no": { + "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, …" + }, + "nqo": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "nr": { + "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, …" + }, + "nso": { + "pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ny": { + "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, …" + }, + "nyn": { + "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, …" + }, + "om": { + "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, …" + }, + "or": { + "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, …" + }, + "os": { + "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, …" + }, + "osa": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "pa": { + "pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "pap": { + "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, …" + }, + "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, …", + "pluralRule-count-many": "v = 0 and i != 1 and i % 10 = 0..1 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 12..14 @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …", + "pluralRule-count-other": " @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "prg": { + "pluralRule-count-zero": "n % 10 = 0 or n % 100 = 11..19 or v = 2 and f % 100 = 11..19 @integer 0, 10~20, 30, 40, 50, 60, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-one": "n % 10 = 1 and n % 100 != 11 or v = 2 and f % 10 = 1 and f % 100 != 11 or v != 2 and f % 10 = 1 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.0, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …", + "pluralRule-count-other": " @integer 2~9, 22~29, 102, 1002, … @decimal 0.2~0.9, 1.2~1.9, 10.2, 100.2, 1000.2, …" + }, + "ps": { + "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, …" + }, + "pt": { + "pluralRule-count-one": "i = 0..1 @integer 0, 1 @decimal 0.0~1.5", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 2.0~3.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "pt-PT": { + "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, …" + }, + "rm": { + "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, …" + }, + "ro": { + "pluralRule-count-one": "i = 1 and v = 0 @integer 1", + "pluralRule-count-few": "v != 0 or n = 0 or n % 100 = 2..19 @integer 0, 2~16, 102, 1002, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-other": " @integer 20~35, 100, 1000, 10000, 100000, 1000000, …" + }, + "rof": { + "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, …" + }, + "root": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ru": { + "pluralRule-count-one": "v = 0 and i % 10 = 1 and i % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …", + "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, …", + "pluralRule-count-many": "v = 0 and i % 10 = 0 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 11..14 @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …", + "pluralRule-count-other": " @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "rwk": { + "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, …" + }, + "sah": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "saq": { + "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, …" + }, + "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, …" + }, + "scn": { + "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, …" + }, + "sd": { + "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, …" + }, + "sdh": { + "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, …" + }, + "se": { + "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, …" + }, + "seh": { + "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, …" + }, + "ses": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "sg": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "sh": { + "pluralRule-count-one": "v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …", + "pluralRule-count-few": "v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, … @decimal 0.2~0.4, 1.2~1.4, 2.2~2.4, 3.2~3.4, 4.2~4.4, 5.2, 10.2, 100.2, 1000.2, …", + "pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 0.5~1.0, 1.5~2.0, 2.5~2.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "shi": { + "pluralRule-count-one": "i = 0 or n = 1 @integer 0, 1 @decimal 0.0~1.0, 0.00~0.04", + "pluralRule-count-few": "n = 2..10 @integer 2~10 @decimal 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00, 8.00", + "pluralRule-count-other": " @integer 11~26, 100, 1000, 10000, 100000, 1000000, … @decimal 1.1~1.9, 2.1~2.7, 10.1, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "si": { + "pluralRule-count-one": "n = 0,1 or i = 0 and f = 1 @integer 0, 1 @decimal 0.0, 0.1, 1.0, 0.00, 0.01, 1.00, 0.000, 0.001, 1.000, 0.0000, 0.0001, 1.0000", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.2~0.9, 1.1~1.8, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "sk": { + "pluralRule-count-one": "i = 1 and v = 0 @integer 1", + "pluralRule-count-few": "i = 2..4 and v = 0 @integer 2~4", + "pluralRule-count-many": "v != 0 @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …" + }, + "sl": { + "pluralRule-count-one": "v = 0 and i % 100 = 1 @integer 1, 101, 201, 301, 401, 501, 601, 701, 1001, …", + "pluralRule-count-two": "v = 0 and i % 100 = 2 @integer 2, 102, 202, 302, 402, 502, 602, 702, 1002, …", + "pluralRule-count-few": "v = 0 and i % 100 = 3..4 or v != 0 @integer 3, 4, 103, 104, 203, 204, 303, 304, 403, 404, 503, 504, 603, 604, 703, 704, 1003, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …" + }, + "sma": { + "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, …" + }, + "smi": { + "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, …" + }, + "smj": { + "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, …" + }, + "smn": { + "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, …" + }, + "sms": { + "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, …" + }, + "sn": { + "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, …" + }, + "so": { + "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, …" + }, + "sq": { + "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, …" + }, + "sr": { + "pluralRule-count-one": "v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …", + "pluralRule-count-few": "v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, … @decimal 0.2~0.4, 1.2~1.4, 2.2~2.4, 3.2~3.4, 4.2~4.4, 5.2, 10.2, 100.2, 1000.2, …", + "pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 0.5~1.0, 1.5~2.0, 2.5~2.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ss": { + "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, …" + }, + "ssy": { + "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, …" + }, + "st": { + "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, …" + }, + "su": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "sv": { + "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, …" + }, + "sw": { + "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, …" + }, + "syr": { + "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, …" + }, + "ta": { + "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, …" + }, + "te": { + "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, …" + }, + "teo": { + "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, …" + }, + "th": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ti": { + "pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "tig": { + "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, …" + }, + "tk": { + "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, …" + }, + "tl": { + "pluralRule-count-one": "v = 0 and i = 1,2,3 or v = 0 and i % 10 != 4,6,9 or v != 0 and f % 10 != 4,6,9 @integer 0~3, 5, 7, 8, 10~13, 15, 17, 18, 20, 21, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~0.3, 0.5, 0.7, 0.8, 1.0~1.3, 1.5, 1.7, 1.8, 2.0, 2.1, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …", + "pluralRule-count-other": " @integer 4, 6, 9, 14, 16, 19, 24, 26, 104, 1004, … @decimal 0.4, 0.6, 0.9, 1.4, 1.6, 1.9, 2.4, 2.6, 10.4, 100.4, 1000.4, …" + }, + "tn": { + "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, …" + }, + "to": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "tr": { + "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, …" + }, + "ts": { + "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, …" + }, + "tzm": { + "pluralRule-count-one": "n = 0..1 or n = 11..99 @integer 0, 1, 11~24 @decimal 0.0, 1.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0", + "pluralRule-count-other": " @integer 2~10, 100~106, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ug": { + "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, …" + }, + "uk": { + "pluralRule-count-one": "v = 0 and i % 10 = 1 and i % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …", + "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, …", + "pluralRule-count-many": "v = 0 and i % 10 = 0 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 11..14 @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …", + "pluralRule-count-other": " @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "ur": { + "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, …" + }, + "uz": { + "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, …" + }, + "ve": { + "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, …" + }, + "vi": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "vo": { + "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, …" + }, + "vun": { + "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, …" + }, + "wa": { + "pluralRule-count-one": "n = 0..1 @integer 0, 1 @decimal 0.0, 1.0, 0.00, 1.00, 0.000, 1.000, 0.0000, 1.0000", + "pluralRule-count-other": " @integer 2~17, 100, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "wae": { + "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, …" + }, + "wo": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "xh": { + "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, …" + }, + "xog": { + "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, …" + }, + "yi": { + "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, …" + }, + "yo": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "yue": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "zh": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + }, + "zu": { + "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, …" + } + } + } +} diff --git a/third_party/rust/intl_pluralrules/cldr_data/cldr_pluralrules_ordinals.json b/third_party/rust/intl_pluralrules/cldr_data/cldr_pluralrules_ordinals.json new file mode 100644 index 000000000000..223ddfbab809 --- /dev/null +++ b/third_party/rust/intl_pluralrules/cldr_data/cldr_pluralrules_ordinals.json @@ -0,0 +1,373 @@ +{ + "supplemental": { + "version": { + "_unicodeVersion": "12.1.0", + "_cldrVersion": "36" + }, + "plurals-type-ordinal": { + "af": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "am": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "an": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "ar": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "as": { + "pluralRule-count-one": "n = 1,5,7,8,9,10 @integer 1, 5, 7~10", + "pluralRule-count-two": "n = 2,3 @integer 2, 3", + "pluralRule-count-few": "n = 4 @integer 4", + "pluralRule-count-many": "n = 6 @integer 6", + "pluralRule-count-other": " @integer 0, 11~25, 100, 1000, 10000, 100000, 1000000, …" + }, + "az": { + "pluralRule-count-one": "i % 10 = 1,2,5,7,8 or i % 100 = 20,50,70,80 @integer 1, 2, 5, 7, 8, 11, 12, 15, 17, 18, 20~22, 25, 101, 1001, …", + "pluralRule-count-few": "i % 10 = 3,4 or i % 1000 = 100,200,300,400,500,600,700,800,900 @integer 3, 4, 13, 14, 23, 24, 33, 34, 43, 44, 53, 54, 63, 64, 73, 74, 100, 1003, …", + "pluralRule-count-many": "i = 0 or i % 10 = 6 or i % 100 = 40,60,90 @integer 0, 6, 16, 26, 36, 40, 46, 56, 106, 1006, …", + "pluralRule-count-other": " @integer 9, 10, 19, 29, 30, 39, 49, 59, 69, 79, 109, 1000, 10000, 100000, 1000000, …" + }, + "be": { + "pluralRule-count-few": "n % 10 = 2,3 and n % 100 != 12,13 @integer 2, 3, 22, 23, 32, 33, 42, 43, 52, 53, 62, 63, 72, 73, 82, 83, 102, 1002, …", + "pluralRule-count-other": " @integer 0, 1, 4~17, 100, 1000, 10000, 100000, 1000000, …" + }, + "bg": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "bn": { + "pluralRule-count-one": "n = 1,5,7,8,9,10 @integer 1, 5, 7~10", + "pluralRule-count-two": "n = 2,3 @integer 2, 3", + "pluralRule-count-few": "n = 4 @integer 4", + "pluralRule-count-many": "n = 6 @integer 6", + "pluralRule-count-other": " @integer 0, 11~25, 100, 1000, 10000, 100000, 1000000, …" + }, + "bs": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "ca": { + "pluralRule-count-one": "n = 1,3 @integer 1, 3", + "pluralRule-count-two": "n = 2 @integer 2", + "pluralRule-count-few": "n = 4 @integer 4", + "pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …" + }, + "ce": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "cs": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "cy": { + "pluralRule-count-zero": "n = 0,7,8,9 @integer 0, 7~9", + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-two": "n = 2 @integer 2", + "pluralRule-count-few": "n = 3,4 @integer 3, 4", + "pluralRule-count-many": "n = 5,6 @integer 5, 6", + "pluralRule-count-other": " @integer 10~25, 100, 1000, 10000, 100000, 1000000, …" + }, + "da": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "de": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "dsb": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "el": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "en": { + "pluralRule-count-one": "n % 10 = 1 and n % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …", + "pluralRule-count-two": "n % 10 = 2 and n % 100 != 12 @integer 2, 22, 32, 42, 52, 62, 72, 82, 102, 1002, …", + "pluralRule-count-few": "n % 10 = 3 and n % 100 != 13 @integer 3, 23, 33, 43, 53, 63, 73, 83, 103, 1003, …", + "pluralRule-count-other": " @integer 0, 4~18, 100, 1000, 10000, 100000, 1000000, …" + }, + "es": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "et": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "eu": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "fa": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "fi": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "fil": { + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …" + }, + "fr": { + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …" + }, + "fy": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "ga": { + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …" + }, + "gd": { + "pluralRule-count-one": "n = 1,11 @integer 1, 11", + "pluralRule-count-two": "n = 2,12 @integer 2, 12", + "pluralRule-count-few": "n = 3,13 @integer 3, 13", + "pluralRule-count-other": " @integer 0, 4~10, 14~21, 100, 1000, 10000, 100000, 1000000, …" + }, + "gl": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "gsw": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "gu": { + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-two": "n = 2,3 @integer 2, 3", + "pluralRule-count-few": "n = 4 @integer 4", + "pluralRule-count-many": "n = 6 @integer 6", + "pluralRule-count-other": " @integer 0, 5, 7~20, 100, 1000, 10000, 100000, 1000000, …" + }, + "he": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "hi": { + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-two": "n = 2,3 @integer 2, 3", + "pluralRule-count-few": "n = 4 @integer 4", + "pluralRule-count-many": "n = 6 @integer 6", + "pluralRule-count-other": " @integer 0, 5, 7~20, 100, 1000, 10000, 100000, 1000000, …" + }, + "hr": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "hsb": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "hu": { + "pluralRule-count-one": "n = 1,5 @integer 1, 5", + "pluralRule-count-other": " @integer 0, 2~4, 6~17, 100, 1000, 10000, 100000, 1000000, …" + }, + "hy": { + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …" + }, + "ia": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "id": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "in": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "is": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "it": { + "pluralRule-count-many": "n = 11,8,80,800 @integer 8, 11, 80, 800", + "pluralRule-count-other": " @integer 0~7, 9, 10, 12~17, 100, 1000, 10000, 100000, 1000000, …" + }, + "iw": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "ja": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "ka": { + "pluralRule-count-one": "i = 1 @integer 1", + "pluralRule-count-many": "i = 0 or i % 100 = 2..20,40,60,80 @integer 0, 2~16, 102, 1002, …", + "pluralRule-count-other": " @integer 21~36, 100, 1000, 10000, 100000, 1000000, …" + }, + "kk": { + "pluralRule-count-many": "n % 10 = 6 or n % 10 = 9 or n % 10 = 0 and n != 0 @integer 6, 9, 10, 16, 19, 20, 26, 29, 30, 36, 39, 40, 100, 1000, 10000, 100000, 1000000, …", + "pluralRule-count-other": " @integer 0~5, 7, 8, 11~15, 17, 18, 21, 101, 1001, …" + }, + "km": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "kn": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "ko": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "kw": { + "pluralRule-count-one": "n = 1..4 or n % 100 = 1..4,21..24,41..44,61..64,81..84 @integer 1~4, 21~24, 41~44, 61~64, 101, 1001, …", + "pluralRule-count-many": "n = 5 or n % 100 = 5 @integer 5, 105, 205, 305, 405, 505, 605, 705, 1005, …", + "pluralRule-count-other": " @integer 0, 6~20, 100, 1000, 10000, 100000, 1000000, …" + }, + "ky": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "lo": { + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …" + }, + "lt": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "lv": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "mk": { + "pluralRule-count-one": "i % 10 = 1 and i % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …", + "pluralRule-count-two": "i % 10 = 2 and i % 100 != 12 @integer 2, 22, 32, 42, 52, 62, 72, 82, 102, 1002, …", + "pluralRule-count-many": "i % 10 = 7,8 and i % 100 != 17,18 @integer 7, 8, 27, 28, 37, 38, 47, 48, 57, 58, 67, 68, 77, 78, 87, 88, 107, 1007, …", + "pluralRule-count-other": " @integer 0, 3~6, 9~19, 100, 1000, 10000, 100000, 1000000, …" + }, + "ml": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "mn": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "mo": { + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …" + }, + "mr": { + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-two": "n = 2,3 @integer 2, 3", + "pluralRule-count-few": "n = 4 @integer 4", + "pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …" + }, + "ms": { + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …" + }, + "my": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "nb": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "ne": { + "pluralRule-count-one": "n = 1..4 @integer 1~4", + "pluralRule-count-other": " @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …" + }, + "nl": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "or": { + "pluralRule-count-one": "n = 1,5,7..9 @integer 1, 5, 7~9", + "pluralRule-count-two": "n = 2,3 @integer 2, 3", + "pluralRule-count-few": "n = 4 @integer 4", + "pluralRule-count-many": "n = 6 @integer 6", + "pluralRule-count-other": " @integer 0, 10~24, 100, 1000, 10000, 100000, 1000000, …" + }, + "pa": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "pl": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "prg": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "ps": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "pt": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "ro": { + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …" + }, + "root": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "ru": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "sc": { + "pluralRule-count-many": "n = 11,8,80,800 @integer 8, 11, 80, 800", + "pluralRule-count-other": " @integer 0~7, 9, 10, 12~17, 100, 1000, 10000, 100000, 1000000, …" + }, + "scn": { + "pluralRule-count-many": "n = 11,8,80,800 @integer 8, 11, 80, 800", + "pluralRule-count-other": " @integer 0~7, 9, 10, 12~17, 100, 1000, 10000, 100000, 1000000, …" + }, + "sd": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "sh": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "si": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "sk": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "sl": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "sq": { + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-many": "n % 10 = 4 and n % 100 != 14 @integer 4, 24, 34, 44, 54, 64, 74, 84, 104, 1004, …", + "pluralRule-count-other": " @integer 0, 2, 3, 5~17, 100, 1000, 10000, 100000, 1000000, …" + }, + "sr": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "sv": { + "pluralRule-count-one": "n % 10 = 1,2 and n % 100 != 11,12 @integer 1, 2, 21, 22, 31, 32, 41, 42, 51, 52, 61, 62, 71, 72, 81, 82, 101, 1001, …", + "pluralRule-count-other": " @integer 0, 3~17, 100, 1000, 10000, 100000, 1000000, …" + }, + "sw": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "ta": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "te": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "th": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "tk": { + "pluralRule-count-few": "n % 10 = 6,9 or n = 10 @integer 6, 9, 10, 16, 19, 26, 29, 36, 39, 106, 1006, …", + "pluralRule-count-other": " @integer 0~5, 7, 8, 11~15, 17, 18, 20, 100, 1000, 10000, 100000, 1000000, …" + }, + "tl": { + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …" + }, + "tr": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "uk": { + "pluralRule-count-few": "n % 10 = 3 and n % 100 != 13 @integer 3, 23, 33, 43, 53, 63, 73, 83, 103, 1003, …", + "pluralRule-count-other": " @integer 0~2, 4~16, 100, 1000, 10000, 100000, 1000000, …" + }, + "ur": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "uz": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "vi": { + "pluralRule-count-one": "n = 1 @integer 1", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, …" + }, + "yue": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "zh": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + }, + "zu": { + "pluralRule-count-other": " @integer 0~15, 100, 1000, 10000, 100000, 1000000, …" + } + } + } +} diff --git a/third_party/rust/intl_pluralrules/src/lib.rs b/third_party/rust/intl_pluralrules/src/lib.rs index 389aacf5b641..50274f58a1e9 100644 --- a/third_party/rust/intl_pluralrules/src/lib.rs +++ b/third_party/rust/intl_pluralrules/src/lib.rs @@ -212,7 +212,7 @@ mod tests { #[test] fn version_test() { - assert_eq!(CLDR_VERSION, 37); + assert_eq!(CLDR_VERSION, 36); } #[test] diff --git a/third_party/rust/intl_pluralrules/src/operands.rs b/third_party/rust/intl_pluralrules/src/operands.rs index 78fa80aff0eb..fc72b4da5552 100644 --- a/third_party/rust/intl_pluralrules/src/operands.rs +++ b/third_party/rust/intl_pluralrules/src/operands.rs @@ -59,15 +59,15 @@ pub struct PluralOperands { /// Absolute value of input pub n: f64, /// Integer value of input - pub i: u64, + pub i: usize, /// Number of visible fraction digits with trailing zeros pub v: usize, /// Number of visible fraction digits without trailing zeros pub w: usize, /// Visible fraction digits with trailing zeros - pub f: u64, + pub f: usize, /// Visible fraction digits without trailing zeros - pub t: u64, + pub t: usize, } impl<'a> TryFrom<&'a str> for PluralOperands { @@ -93,17 +93,17 @@ impl<'a> TryFrom<&'a str> for PluralOperands { let dec_str = &abs_str[(dec_pos + 1)..]; integer_digits = - u64::from_str(&int_str).map_err(|_| "Could not convert string to integer!")?; + usize::from_str(&int_str).map_err(|_| "Could not convert string to integer!")?; let backtrace = dec_str.trim_end_matches('0'); num_fraction_digits0 = dec_str.len() as usize; num_fraction_digits = backtrace.len() as usize; fraction_digits0 = - u64::from_str(dec_str).map_err(|_| "Could not convert string to integer!")?; - fraction_digits = u64::from_str(backtrace).unwrap_or(0); + usize::from_str(dec_str).map_err(|_| "Could not convert string to integer!")?; + fraction_digits = usize::from_str(backtrace).unwrap_or(0); } else { - integer_digits = absolute_value as u64; + integer_digits = absolute_value as usize; num_fraction_digits0 = 0; num_fraction_digits = 0; fraction_digits0 = 0; @@ -128,7 +128,7 @@ macro_rules! impl_integer_type { // XXXManishearth converting from u32 or u64 to isize may wrap PluralOperands { n: input as f64, - i: input as u64, + i: input as usize, v: 0, w: 0, f: 0, @@ -151,7 +151,7 @@ macro_rules! impl_signed_integer_type { let x = (input as isize).checked_abs().ok_or("Number too big")?; Ok(PluralOperands { n: x as f64, - i: x as u64, + i: x as usize, v: 0, w: 0, f: 0, diff --git a/third_party/rust/intl_pluralrules/src/rules.rs b/third_party/rust/intl_pluralrules/src/rules.rs index 35984b64edba..91d37c7b82e8 100644 --- a/third_party/rust/intl_pluralrules/src/rules.rs +++ b/third_party/rust/intl_pluralrules/src/rules.rs @@ -4,10 +4,10 @@ #![cfg_attr(feature = "cargo-clippy", allow(clippy::nonminimal_bool))] use super::operands::PluralOperands; use super::PluralCategory; -use unic_langid::subtags; +use tinystr::{TinyStr4, TinyStr8}; use unic_langid::LanguageIdentifier; pub type PluralRule = fn(&PluralOperands) -> PluralCategory; -pub static CLDR_VERSION: usize = 37; +pub static CLDR_VERSION: usize = 36; macro_rules! langid { ( $ lang : expr , $ script : expr , $ region : expr ) => {{ unsafe { LanguageIdentifier::from_raw_parts_unchecked($lang, $script, $region, None) } @@ -15,7 +15,7 @@ macro_rules! langid { } pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ ( - langid!(subtags::Language::from_raw_unchecked(26209u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26209u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -25,7 +25,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27489u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27489u64)), None, None), |po| { if ((0..=1).contains(&(po.i)) && po.f == 0) { PluralCategory::ONE @@ -35,7 +35,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28001u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28001u64)), None, None), |po| { if (po.i == 0) || (po.n == 1.0) { PluralCategory::ONE @@ -45,7 +45,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28257u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28257u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -55,7 +55,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29281u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29281u64)), None, None), |po| { if ((3..=10).contains(&(po.i))) { PluralCategory::FEW @@ -73,11 +73,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7565921u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7565921u64)), None, None), |po| { if ((3..=10).contains(&(po.i))) { PluralCategory::FEW @@ -95,7 +91,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29537u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29537u64)), None, None), |po| { if (po.i == 0) || (po.n == 1.0) { PluralCategory::ONE @@ -105,11 +101,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6386529u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6386529u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -119,11 +111,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7631713u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7631713u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -133,7 +121,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(31329u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31329u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -143,7 +131,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25954u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25954u64)), None, None), |po| { if ((2..=4).contains(&(po.i)) && !(12..=14).contains(&(po.i))) { PluralCategory::FEW @@ -160,11 +148,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7169378u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7169378u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -174,11 +158,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(8021346u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(8021346u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -188,7 +168,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(26466u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26466u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -198,11 +178,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7301218u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7301218u64)), None, None), |po| { if ((0..=1).contains(&(po.i)) && po.f == 0) { PluralCategory::ONE @@ -212,11 +188,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28002u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28002u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28258u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28258u64)), None, None), |po| { if (po.i == 0) || (po.n == 1.0) { PluralCategory::ONE @@ -226,11 +202,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28514u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28514u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29282u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29282u64)), None, None), |po| { if ((po.i % 10 == 9 || (3..=4).contains(&(po.i))) && !(10..=19).contains(&(po.i)) @@ -250,11 +226,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7893602u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7893602u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -264,7 +236,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29538u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29538u64)), None, None), |po| { if (po.v == 0 && (2..=4).contains(&(po.i % 10)) && !(12..=14).contains(&(po.i % 100))) || ((2..=4).contains(&(po.f % 10)) && !(12..=14).contains(&(po.f % 100))) @@ -280,7 +252,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(24931u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24931u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -290,7 +262,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25955u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25955u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -300,11 +272,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6448483u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6448483u64)), None, None), |po| { if (po.v == 0 && (po.i == 1 || po.i == 2 || po.i == 3)) || (po.v == 0 && po.i % 10 != 4 && po.i % 10 != 6 && po.i % 10 != 9) @@ -317,11 +285,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6776675u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6776675u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -331,11 +295,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7497827u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7497827u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -345,11 +305,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6450019u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6450019u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -359,7 +315,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29539u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29539u64)), None, None), |po| { if ((2..=4).contains(&(po.i)) && po.v == 0) { PluralCategory::FEW @@ -373,7 +329,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(31075u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31075u64)), None, None), |po| { if (po.n == 3.0) { PluralCategory::FEW @@ -391,7 +347,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(24932u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24932u64)), None, None), |po| { if (po.n == 1.0) || (po.t != 0 && (po.i == 0 || po.i == 1)) { PluralCategory::ONE @@ -401,7 +357,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25956u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25956u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -411,11 +367,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6452068u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6452068u64)), None, None), |po| { if (po.v == 0 && (3..=4).contains(&(po.i % 100))) || ((3..=4).contains(&(po.f % 100))) { PluralCategory::FEW @@ -429,7 +381,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30308u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30308u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -439,11 +391,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(31332u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31332u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(25957u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25957u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -453,7 +405,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27749u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27749u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -463,7 +415,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28261u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28261u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -473,7 +425,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28517u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28517u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -483,7 +435,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29541u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29541u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -493,7 +445,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29797u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29797u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -503,7 +455,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30053u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30053u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -513,7 +465,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(24934u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24934u64)), None, None), |po| { if (po.i == 0) || (po.n == 1.0) { PluralCategory::ONE @@ -523,7 +475,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(26214u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26214u64)), None, None), |po| { if (po.i == 0 || po.i == 1) { PluralCategory::ONE @@ -533,7 +485,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(26982u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26982u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -543,11 +495,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7104870u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7104870u64)), None, None), |po| { if (po.v == 0 && (po.i == 1 || po.i == 2 || po.i == 3)) || (po.v == 0 && po.i % 10 != 4 && po.i % 10 != 6 && po.i % 10 != 9) @@ -560,7 +508,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28518u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28518u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -570,7 +518,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29286u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29286u64)), None, None), |po| { if (po.i == 0 || po.i == 1) { PluralCategory::ONE @@ -580,11 +528,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7501158u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7501158u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -594,7 +538,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(31078u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31078u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -604,7 +548,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(24935u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24935u64)), None, None), |po| { if ((3..=6).contains(&(po.i)) && po.f == 0) { PluralCategory::FEW @@ -620,7 +564,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25703u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25703u64)), None, None), |po| { if ((3..=10).contains(&(po.i)) && po.f == 0 || (13..=19).contains(&(po.i)) && po.f == 0) { @@ -635,7 +579,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27751u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27751u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -645,11 +589,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7828327u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7828327u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -659,7 +599,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30055u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30055u64)), None, None), |po| { if (po.i == 0) || (po.n == 1.0) { PluralCategory::ONE @@ -669,11 +609,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7828839u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7828839u64)), None, None), |po| { if ((0..=1).contains(&(po.i)) && po.f == 0) { PluralCategory::ONE @@ -683,7 +619,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30311u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30311u64)), None, None), |po| { if (po.v == 0 && (po.i % 100 == 0 @@ -705,7 +641,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(24936u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24936u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -715,11 +651,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7823720u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7823720u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -729,7 +661,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25960u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25960u64)), None, None), |po| { if (po.v == 0 && !(0..=10).contains(&(po.i)) && po.f == 0 && po.i % 10 == 0) { PluralCategory::MANY @@ -743,7 +675,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(26984u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26984u64)), None, None), |po| { if (po.i == 0) || (po.n == 1.0) { PluralCategory::ONE @@ -753,7 +685,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29288u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29288u64)), None, None), |po| { if (po.v == 0 && (2..=4).contains(&(po.i % 10)) && !(12..=14).contains(&(po.i % 100))) || ((2..=4).contains(&(po.f % 10)) && !(12..=14).contains(&(po.f % 100))) @@ -769,11 +701,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6452072u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6452072u64)), None, None), |po| { if (po.v == 0 && (3..=4).contains(&(po.i % 100))) || ((3..=4).contains(&(po.f % 100))) { PluralCategory::FEW @@ -787,7 +715,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30056u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30056u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -797,7 +725,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(31080u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31080u64)), None, None), |po| { if (po.i == 0 || po.i == 1) { PluralCategory::ONE @@ -807,7 +735,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(24937u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24937u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -817,23 +745,23 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25705u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25705u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(26473u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26473u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(26985u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26985u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28265u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28265u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28521u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28521u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -843,7 +771,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29545u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29545u64)), None, None), |po| { if (po.t == 0 && po.i % 10 == 1 && po.i % 100 != 11) || (po.t != 0) { PluralCategory::ONE @@ -853,7 +781,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29801u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29801u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -863,7 +791,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30057u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30057u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -875,7 +803,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30569u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30569u64)), None, None), |po| { if (po.v == 0 && !(0..=10).contains(&(po.i)) && po.f == 0 && po.i % 10 == 0) { PluralCategory::MANY @@ -889,23 +817,15 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(24938u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24938u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!( - subtags::Language::from_raw_unchecked(7299690u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7299690u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!( - subtags::Language::from_raw_unchecked(7300970u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7300970u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -915,7 +835,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(26986u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26986u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -925,11 +845,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6516074u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6516074u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -939,15 +855,15 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30314u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30314u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(30570u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30570u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(24939u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24939u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -957,11 +873,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6447467u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6447467u64)), None, None), |po| { if (po.i == 0 || po.i == 1) { PluralCategory::ONE @@ -971,11 +883,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6971755u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6971755u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -985,11 +893,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6775659u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6775659u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -999,23 +903,15 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6644843u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6644843u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!( - subtags::Language::from_raw_unchecked(6382955u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6382955u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(27499u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27499u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1025,11 +921,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6974315u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6974315u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1039,7 +931,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27755u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27755u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1049,11 +941,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28011u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28011u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28267u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28267u64)), None, None), |po| { if (po.i == 0) || (po.n == 1.0) { PluralCategory::ONE @@ -1063,11 +955,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28523u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28523u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29547u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29547u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1077,11 +969,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6452075u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6452075u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1091,11 +979,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6845291u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6845291u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1107,7 +991,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30059u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30059u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1117,7 +1001,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30571u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30571u64)), None, None), |po| { if (po.i % 100 == 3 || po.i % 100 == 23 @@ -1157,7 +1041,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(31083u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31083u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1167,11 +1051,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6775148u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6775148u64)), None, None), |po| { if ((po.i == 0 || po.i == 1) && po.n != 0.0) { PluralCategory::ONE @@ -1183,7 +1063,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25196u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25196u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1193,7 +1073,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(26476u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26476u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1203,15 +1083,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7629676u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7629676u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28268u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28268u64)), None, None), |po| { if ((0..=1).contains(&(po.i)) && po.f == 0) { PluralCategory::ONE @@ -1221,11 +1097,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28524u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28524u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29804u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29804u64)), None, None), |po| { if ((2..=9).contains(&(po.i)) && !(11..=19).contains(&(po.i))) { PluralCategory::FEW @@ -1239,7 +1115,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30316u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30316u64)), None, None), |po| { if (po.i % 10 == 1 && po.i % 100 != 11) || (po.v == 2 && po.f % 10 == 1 && po.f % 100 != 11) @@ -1257,11 +1133,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7561581u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7561581u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1271,7 +1143,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(26477u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26477u64)), None, None), |po| { if ((0..=1).contains(&(po.i)) && po.f == 0) { PluralCategory::ONE @@ -1281,11 +1153,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7300973u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7300973u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1295,7 +1163,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27501u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27501u64)), None, None), |po| { if (po.v == 0 && po.i % 10 == 1 && po.i % 100 != 11) || (po.f % 10 == 1 && po.f % 100 != 11) @@ -1307,7 +1175,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27757u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27757u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1317,7 +1185,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28269u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28269u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1327,7 +1195,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28525u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28525u64)), None, None), |po| { if (po.v != 0) || (po.n == 0.0) || ((2..=19).contains(&(po.i))) { PluralCategory::FEW @@ -1339,7 +1207,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29293u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29293u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1349,11 +1217,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29549u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29549u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29805u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29805u64)), None, None), |po| { if (po.n == 0.0) || ((2..=10).contains(&(po.i))) { PluralCategory::FEW @@ -1367,15 +1235,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(31085u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31085u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!( - subtags::Language::from_raw_unchecked(6840686u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6840686u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1385,11 +1249,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7430510u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7430510u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1401,7 +1261,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25198u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25198u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1411,7 +1271,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25710u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25710u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1421,7 +1281,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25966u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25966u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1431,7 +1291,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27758u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27758u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -1441,7 +1301,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28270u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28270u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1451,11 +1311,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6844014u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6844014u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1465,7 +1321,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28526u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28526u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1475,15 +1331,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7303534u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7303534u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29294u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29294u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1493,11 +1345,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7304046u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7304046u64)), None, None), |po| { if ((0..=1).contains(&(po.i)) && po.f == 0) { PluralCategory::ONE @@ -1507,7 +1355,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(31086u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31086u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1517,11 +1365,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7240046u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7240046u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1531,7 +1375,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28015u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28015u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1541,7 +1385,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29295u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29295u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1551,7 +1395,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29551u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29551u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1561,15 +1405,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6386543u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6386543u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(24944u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24944u64)), None, None), |po| { if ((0..=1).contains(&(po.i)) && po.f == 0) { PluralCategory::ONE @@ -1579,11 +1419,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7364976u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7364976u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1593,21 +1429,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7168880u64), - None, - None - ), - |po| { - if (po.i == 0) || (po.n == 1.0) { - PluralCategory::ONE - } else { - PluralCategory::OTHER - } - }, - ), - ( - langid!(subtags::Language::from_raw_unchecked(27760u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27760u64)), None, None), |po| { if (po.v == 0 && (2..=4).contains(&(po.i % 10)) && !(12..=14).contains(&(po.i % 100))) { PluralCategory::FEW @@ -1624,11 +1446,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6779504u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6779504u64)), None, None), |po| { if (po.i % 10 == 1 && po.i % 100 != 11) || (po.v == 2 && po.f % 10 == 1 && po.f % 100 != 11) @@ -1646,7 +1464,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29552u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29552u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1656,7 +1474,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29808u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29808u64)), None, None), |po| { if ((0..=1).contains(&(po.i))) { PluralCategory::ONE @@ -1667,9 +1485,9 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ ), ( langid!( - subtags::Language::from_raw_unchecked(29808u64), + Some(TinyStr8::new_unchecked(29808u64)), None, - Some(subtags::Region::from_raw_unchecked(21584u32)) + Some(TinyStr4::new_unchecked(21584u32)) ), |po| { if (po.i == 1 && po.v == 0) { @@ -1680,7 +1498,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28018u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28018u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1690,7 +1508,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28530u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28530u64)), None, None), |po| { if (po.v != 0) || (po.n == 0.0) || ((2..=19).contains(&(po.i))) { PluralCategory::FEW @@ -1702,11 +1520,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6713202u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6713202u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1716,7 +1530,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30066u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30066u64)), None, None), |po| { if (po.v == 0 && (2..=4).contains(&(po.i % 10)) && !(12..=14).contains(&(po.i % 100))) { PluralCategory::FEW @@ -1733,11 +1547,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7042930u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7042930u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1747,19 +1557,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6840691u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6840691u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!( - subtags::Language::from_raw_unchecked(7430515u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7430515u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1769,11 +1571,47 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7627123u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(25459u64)), None, None), + |po| { + if (po.i == 1 && po.v == 0) { + PluralCategory::ONE + } else { + PluralCategory::OTHER + } + }, + ), + ( + langid!(Some(TinyStr8::new_unchecked(7234419u64)), None, None), + |po| { + if (po.i == 1 && po.v == 0) { + PluralCategory::ONE + } else { + PluralCategory::OTHER + } + }, + ), + ( + langid!(Some(TinyStr8::new_unchecked(25715u64)), None, None), + |po| { + if (po.n == 1.0) { + PluralCategory::ONE + } else { + PluralCategory::OTHER + } + }, + ), + ( + langid!(Some(TinyStr8::new_unchecked(6841459u64)), None, None), + |po| { + if (po.n == 1.0) { + PluralCategory::ONE + } else { + PluralCategory::OTHER + } + }, + ), + ( + langid!(Some(TinyStr8::new_unchecked(25971u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1785,31 +1623,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25459u64), None, None), - |po| { - if (po.i == 1 && po.v == 0) { - PluralCategory::ONE - } else { - PluralCategory::OTHER - } - }, - ), - ( - langid!( - subtags::Language::from_raw_unchecked(7234419u64), - None, - None - ), - |po| { - if (po.i == 1 && po.v == 0) { - PluralCategory::ONE - } else { - PluralCategory::OTHER - } - }, - ), - ( - langid!(subtags::Language::from_raw_unchecked(25715u64), None, None), + langid!(Some(TinyStr8::new_unchecked(6841715u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1819,59 +1633,15 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6841459u64), - None, - None - ), - |po| { - if (po.n == 1.0) { - PluralCategory::ONE - } else { - PluralCategory::OTHER - } - }, - ), - ( - langid!(subtags::Language::from_raw_unchecked(25971u64), None, None), - |po| { - if (po.n == 1.0) { - PluralCategory::ONE - } else if (po.n == 2.0) { - PluralCategory::TWO - } else { - PluralCategory::OTHER - } - }, - ), - ( - langid!( - subtags::Language::from_raw_unchecked(6841715u64), - None, - None - ), - |po| { - if (po.n == 1.0) { - PluralCategory::ONE - } else { - PluralCategory::OTHER - } - }, - ), - ( - langid!( - subtags::Language::from_raw_unchecked(7562611u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7562611u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(26483u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26483u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(26739u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26739u64)), None, None), |po| { if (po.v == 0 && (2..=4).contains(&(po.i % 10)) && !(12..=14).contains(&(po.i % 100))) || ((2..=4).contains(&(po.f % 10)) && !(12..=14).contains(&(po.f % 100))) @@ -1887,11 +1657,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6908019u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6908019u64)), None, None), |po| { if ((2..=10).contains(&(po.i)) && po.f == 0) { PluralCategory::FEW @@ -1903,7 +1669,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(26995u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26995u64)), None, None), |po| { if (po.n == 0.0 || po.n == 1.0) || (po.i == 0 && po.f == 1) { PluralCategory::ONE @@ -1913,7 +1679,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27507u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27507u64)), None, None), |po| { if ((2..=4).contains(&(po.i)) && po.v == 0) { PluralCategory::FEW @@ -1927,7 +1693,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27763u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27763u64)), None, None), |po| { if (po.v == 0 && (3..=4).contains(&(po.i % 100))) || (po.v != 0) { PluralCategory::FEW @@ -1941,11 +1707,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6385011u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6385011u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1957,11 +1719,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6909299u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6909299u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1973,11 +1731,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6974835u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6974835u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -1989,11 +1743,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7236979u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7236979u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2005,11 +1755,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7564659u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7564659u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2021,7 +1767,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28275u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28275u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2031,7 +1777,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28531u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28531u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2041,7 +1787,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29043u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29043u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2051,7 +1797,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29299u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29299u64)), None, None), |po| { if (po.v == 0 && (2..=4).contains(&(po.i % 10)) && !(12..=14).contains(&(po.i % 100))) || ((2..=4).contains(&(po.f % 10)) && !(12..=14).contains(&(po.f % 100))) @@ -2067,7 +1813,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29555u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29555u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2077,11 +1823,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7959411u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7959411u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2091,7 +1833,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29811u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29811u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2101,11 +1843,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30067u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30067u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(30323u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30323u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -2115,7 +1857,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30579u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30579u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -2125,11 +1867,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7502195u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7502195u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2139,7 +1877,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(24948u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24948u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2149,7 +1887,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25972u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25972u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2159,11 +1897,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7300468u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7300468u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2173,11 +1907,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(26740u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26740u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(26996u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26996u64)), None, None), |po| { if ((0..=1).contains(&(po.i)) && po.f == 0) { PluralCategory::ONE @@ -2187,11 +1921,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6777204u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6777204u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2201,7 +1931,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27508u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27508u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2211,7 +1941,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27764u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27764u64)), None, None), |po| { if (po.v == 0 && (po.i == 1 || po.i == 2 || po.i == 3)) || (po.v == 0 && po.i % 10 != 4 && po.i % 10 != 6 && po.i % 10 != 9) @@ -2224,7 +1954,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28276u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28276u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2234,11 +1964,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28532u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28532u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29300u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29300u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2248,7 +1978,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29556u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29556u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2258,11 +1988,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7174772u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7174772u64)), None, None), |po| { if ((0..=1).contains(&(po.i)) && po.f == 0) || ((11..=99).contains(&(po.i)) && po.f == 0) @@ -2274,7 +2000,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(26485u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26485u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2284,7 +2010,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27509u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27509u64)), None, None), |po| { if (po.v == 0 && (2..=4).contains(&(po.i % 10)) && !(12..=14).contains(&(po.i % 100))) { PluralCategory::FEW @@ -2301,7 +2027,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29301u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29301u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -2311,7 +2037,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(31349u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31349u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2321,7 +2047,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25974u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25974u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2331,11 +2057,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(26998u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26998u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28534u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28534u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2345,11 +2071,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7239030u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7239030u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2359,7 +2081,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(24951u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24951u64)), None, None), |po| { if ((0..=1).contains(&(po.i)) && po.f == 0) { PluralCategory::ONE @@ -2369,11 +2091,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6644087u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6644087u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2383,11 +2101,11 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28535u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28535u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(26744u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26744u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2397,11 +2115,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6778744u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6778744u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2411,7 +2125,7 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27001u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27001u64)), None, None), |po| { if (po.i == 1 && po.v == 0) { PluralCategory::ONE @@ -2421,23 +2135,19 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28537u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28537u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!( - subtags::Language::from_raw_unchecked(6649209u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6649209u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(26746u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26746u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(30074u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30074u64)), None, None), |po| { if (po.i == 0) || (po.n == 1.0) { PluralCategory::ONE @@ -2449,23 +2159,23 @@ pub const PRS_CARDINAL: &[(LanguageIdentifier, PluralRule)] = &[ ]; pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ ( - langid!(subtags::Language::from_raw_unchecked(26209u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26209u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28001u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28001u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28257u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28257u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29281u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29281u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29537u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29537u64)), None, None), |po| { if (po.n == 4.0) { PluralCategory::FEW @@ -2487,7 +2197,7 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(31329u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31329u64)), None, None), |po| { if (po.i % 10 == 3 || po.i % 10 == 4) || (po.i % 1000 == 100 @@ -2520,7 +2230,7 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25954u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25954u64)), None, None), |po| { if ((po.i % 10 == 2 || po.i % 10 == 3) && po.i % 100 != 12 && po.i % 100 != 13) { PluralCategory::FEW @@ -2530,11 +2240,11 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(26466u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26466u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28258u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28258u64)), None, None), |po| { if (po.n == 4.0) { PluralCategory::FEW @@ -2556,11 +2266,11 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29538u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29538u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(24931u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24931u64)), None, None), |po| { if (po.n == 4.0) { PluralCategory::FEW @@ -2574,15 +2284,15 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25955u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25955u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29539u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29539u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(31075u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31075u64)), None, None), |po| { if (po.n == 3.0 || po.n == 4.0) { PluralCategory::FEW @@ -2600,27 +2310,23 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(24932u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24932u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(25956u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25956u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!( - subtags::Language::from_raw_unchecked(6452068u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6452068u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(27749u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27749u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28261u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28261u64)), None, None), |po| { if (po.i % 10 == 3 && po.i % 100 != 13) { PluralCategory::FEW @@ -2634,31 +2340,27 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29541u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29541u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29797u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29797u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(30053u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30053u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(24934u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24934u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(26982u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26982u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!( - subtags::Language::from_raw_unchecked(7104870u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7104870u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2668,7 +2370,7 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29286u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29286u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2678,11 +2380,11 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(31078u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31078u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(24935u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24935u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2692,7 +2394,7 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25703u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25703u64)), None, None), |po| { if (po.n == 3.0 || po.n == 13.0) { PluralCategory::FEW @@ -2706,19 +2408,15 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27751u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27751u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!( - subtags::Language::from_raw_unchecked(7828327u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7828327u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(30055u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30055u64)), None, None), |po| { if (po.n == 4.0) { PluralCategory::FEW @@ -2734,11 +2432,11 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25960u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25960u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(26984u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26984u64)), None, None), |po| { if (po.n == 4.0) { PluralCategory::FEW @@ -2754,19 +2452,15 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29288u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29288u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!( - subtags::Language::from_raw_unchecked(6452072u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6452072u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(30056u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30056u64)), None, None), |po| { if (po.n == 1.0 || po.n == 5.0) { PluralCategory::ONE @@ -2776,7 +2470,7 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(31080u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31080u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2786,23 +2480,23 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(24937u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24937u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(25705u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25705u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28265u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28265u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29545u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29545u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29801u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29801u64)), None, None), |po| { if (po.n == 11.0 || po.n == 8.0 || po.n == 80.0 || po.n == 800.0) { PluralCategory::MANY @@ -2812,15 +2506,15 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30569u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30569u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(24938u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24938u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(24939u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24939u64)), None, None), |po| { if (po.i == 0) || (po.i % 100 == 40 @@ -2837,7 +2531,7 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27499u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27499u64)), None, None), |po| { if (po.i % 10 == 6) || (po.i % 10 == 9) || (po.i % 10 == 0 && po.n != 0.0) { PluralCategory::MANY @@ -2847,19 +2541,19 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(28011u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28011u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28267u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28267u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28523u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28523u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(30571u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30571u64)), None, None), |po| { if (po.n == 5.0) || (po.i % 100 == 5) { PluralCategory::MANY @@ -2877,11 +2571,11 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(31083u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31083u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28524u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28524u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2891,15 +2585,15 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29804u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29804u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(30316u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30316u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(27501u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27501u64)), None, None), |po| { if ((po.i % 10 == 7 || po.i % 10 == 8) && po.i % 100 != 17 && po.i % 100 != 18) { PluralCategory::MANY @@ -2913,15 +2607,15 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27757u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27757u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28269u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28269u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28525u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28525u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2931,7 +2625,7 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29293u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29293u64)), None, None), |po| { if (po.n == 4.0) { PluralCategory::FEW @@ -2945,7 +2639,7 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29549u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29549u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -2955,15 +2649,15 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(31085u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31085u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(25198u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25198u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(25966u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25966u64)), None, None), |po| { if ((1..=4).contains(&(po.i)) && po.f == 0) { PluralCategory::ONE @@ -2973,11 +2667,11 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27758u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27758u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29295u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29295u64)), None, None), |po| { if (po.n == 4.0) { PluralCategory::FEW @@ -2993,31 +2687,27 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(24944u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24944u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(27760u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27760u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!( - subtags::Language::from_raw_unchecked(6779504u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6779504u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29552u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29552u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29808u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29808u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(28530u64), None, None), + langid!(Some(TinyStr8::new_unchecked(28530u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -3027,11 +2717,11 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30066u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30066u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(25459u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25459u64)), None, None), |po| { if (po.n == 11.0 || po.n == 8.0 || po.n == 80.0 || po.n == 800.0) { PluralCategory::MANY @@ -3041,11 +2731,7 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(7234419u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(7234419u64)), None, None), |po| { if (po.n == 11.0 || po.n == 8.0 || po.n == 80.0 || po.n == 800.0) { PluralCategory::MANY @@ -3055,27 +2741,27 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(25715u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25715u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(26739u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26739u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(26995u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26995u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(27507u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27507u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(27763u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27763u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(29043u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29043u64)), None, None), |po| { if (po.i % 10 == 4 && po.i % 100 != 14) { PluralCategory::MANY @@ -3087,11 +2773,11 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29299u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29299u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(30323u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30323u64)), None, None), |po| { if ((po.i % 10 == 1 || po.i % 10 == 2) && po.i % 100 != 11 && po.i % 100 != 12) { PluralCategory::ONE @@ -3101,23 +2787,23 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(30579u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30579u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(24948u64), None, None), + langid!(Some(TinyStr8::new_unchecked(24948u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(25972u64), None, None), + langid!(Some(TinyStr8::new_unchecked(25972u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(26740u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26740u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(27508u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27508u64)), None, None), |po| { if (po.i % 10 == 6 || po.i % 10 == 9) || (po.n == 10.0) { PluralCategory::FEW @@ -3127,7 +2813,7 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(27764u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27764u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -3137,11 +2823,11 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29300u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29300u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(27509u64), None, None), + langid!(Some(TinyStr8::new_unchecked(27509u64)), None, None), |po| { if (po.i % 10 == 3 && po.i % 100 != 13) { PluralCategory::FEW @@ -3151,15 +2837,15 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!(subtags::Language::from_raw_unchecked(29301u64), None, None), + langid!(Some(TinyStr8::new_unchecked(29301u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(31349u64), None, None), + langid!(Some(TinyStr8::new_unchecked(31349u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(26998u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26998u64)), None, None), |po| { if (po.n == 1.0) { PluralCategory::ONE @@ -3169,19 +2855,15 @@ pub const PRS_ORDINAL: &[(LanguageIdentifier, PluralRule)] = &[ }, ), ( - langid!( - subtags::Language::from_raw_unchecked(6649209u64), - None, - None - ), + langid!(Some(TinyStr8::new_unchecked(6649209u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(26746u64), None, None), + langid!(Some(TinyStr8::new_unchecked(26746u64)), None, None), |po| PluralCategory::OTHER, ), ( - langid!(subtags::Language::from_raw_unchecked(30074u64), None, None), + langid!(Some(TinyStr8::new_unchecked(30074u64)), None, None), |po| PluralCategory::OTHER, ), ]; diff --git a/third_party/rust/intl_pluralrules/tests/operands.rs b/third_party/rust/intl_pluralrules/tests/operands.rs new file mode 100644 index 000000000000..7a69eec09d91 --- /dev/null +++ b/third_party/rust/intl_pluralrules/tests/operands.rs @@ -0,0 +1,133 @@ +// Still want to test +// Non-numeric input +// Empty Input + +use std::convert::{TryFrom, TryInto}; + +use intl_pluralrules::{operands::*, PluralRuleType, PluralRules}; +use unic_langid::LanguageIdentifier; + +#[test] +fn test_operands_from_str() { + let tests = vec![ + ((0_f64, 0, 0, 0, 0, 0), "0"), + ((2_f64, 2, 0, 0, 0, 0), "2"), + ((57_f64, 57, 0, 0, 0, 0), "57"), + ((987_f64, 987, 0, 0, 0, 0), "987"), + ((1234567_f64, 1234567, 0, 0, 0, 0), "1234567"), + ((10_f64, 10, 0, 0, 0, 0), "-10"), + ((1000000_f64, 1000000, 0, 0, 0, 0), "-1000000"), + ((0.23_f64, 0, 2, 2, 23, 23), "0.23"), + ((0.230_f64, 0, 3, 2, 230, 23), "0.230"), + ((23.00_f64, 23, 2, 0, 00, 0), "23.00"), + ((0.0203000_f64, 0, 7, 4, 203000, 203), "0.0203000"), + ((123.45_f64, 123, 2, 2, 45, 45), "123.45"), + ((1234.567_f64, 1234, 3, 3, 567, 567), "-1234.567"), + ]; + + for test in tests { + assert_eq!( + Ok(PluralOperands { + n: (test.0).0, + i: (test.0).1, + v: (test.0).2, + w: (test.0).3, + f: (test.0).4, + t: (test.0).5, + }), + PluralOperands::try_from(test.1) + ); + } +} + +#[test] +fn test_operands_from_int() { + let tests = vec![ + ((0_f64, 0, 0, 0, 0, 0), 0), + ((2_f64, 2, 0, 0, 0, 0), 2), + ((57_f64, 57, 0, 0, 0, 0), 57), + ((987_f64, 987, 0, 0, 0, 0), 987), + ((1234567_f64, 1234567, 0, 0, 0, 0), 1234567), + ((10_f64, 10, 0, 0, 0, 0), -10), + ((1000000_f64, 1000000, 0, 0, 0, 0), -1000000), + ]; + + for test in tests { + assert_eq!( + Ok(PluralOperands { + n: (test.0).0, + i: (test.0).1, + v: (test.0).2, + w: (test.0).3, + f: (test.0).4, + t: (test.0).5, + }), + PluralOperands::try_from(test.1) + ); + } +} + +#[test] +fn test_operands_from_float() { + let tests = vec![ + ((0.23_f64, 0, 2, 2, 23, 23), 0.23), + ((0.230_f64, 0, 2, 2, 23, 23), 0.230), + ((0.0203000_f64, 0, 4, 4, 203, 203), 0.0203000), + ((123.45_f64, 123, 2, 2, 45, 45), 123.45), + ((1234.567_f64, 1234, 3, 3, 567, 567), -1234.567), + ]; + + for test in tests { + assert_eq!( + Ok(PluralOperands { + n: (test.0).0, + i: (test.0).1, + v: (test.0).2, + w: (test.0).3, + f: (test.0).4, + t: (test.0).5, + }), + PluralOperands::try_from(test.1) + ); + } +} + +#[test] +fn test_incorrect_operand() { + assert_eq!(PluralOperands::try_from("foo").is_err(), true); +} + +#[test] +fn test_get_locale() { + let langid: LanguageIdentifier = "naq".parse().expect("Parsing failed."); + let pr_naq = PluralRules::create(langid.clone(), PluralRuleType::CARDINAL).unwrap(); + assert_eq!(pr_naq.get_locale(), &langid); +} + +#[test] +fn custom_type() { + use intl_pluralrules::{PluralCategory, PluralRuleType, PluralRules}; + struct MyType { + value: isize, + } + + impl TryInto for MyType { + type Error = &'static str; + fn try_into(self) -> Result { + Ok(PluralOperands { + n: self.value as f64, + i: self.value as usize, + v: 0, + w: 0, + f: 0, + t: 0, + }) + } + } + + let langid: LanguageIdentifier = "en".parse().expect("Parsing failed."); + let pr = PluralRules::create(langid, PluralRuleType::CARDINAL).unwrap(); + let v = MyType { value: 5 }; + + assert_eq!(pr.select(v), Ok(PluralCategory::OTHER)); +} diff --git a/third_party/rust/unic-langid-impl/.cargo-checksum.json b/third_party/rust/unic-langid-impl/.cargo-checksum.json index df7e26b58c73..30c51627a448 100644 --- a/third_party/rust/unic-langid-impl/.cargo-checksum.json +++ b/third_party/rust/unic-langid-impl/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.lock":"7a6bb71d558693114436f11f7089237447a936cc8365f8afe0305e0b68dae07b","Cargo.toml":"0495636d8071b0d804764190a2daa3f6f780336d80bd8712ef7c197963fd5ce4","README.md":"1ce686b1ba46e7fff771db934d1e8905e3d96c73d9e6712ca85011cf63cf4157","benches/canonicalize.rs":"1bc9db6454ed711c1c1d58a9236d1ed02c40645782338697812dc21b26c2295f","benches/langid.rs":"46dc68e1ee1c998fe957035c11c373cc5d2c2993dd3058aeb36014028618a46e","benches/likely_subtags.rs":"672b47687d20d4294e2de78dc6eb1d36400a4b4c672082d15415fb18faf2e508","benches/parser.rs":"f9cf158bf5d146ef413e63e952c0a866269ba2be0db44a0aa88a5e61fdf53b4a","data/cldr-misc-full/README.md":"b4bbc8e56b8c9f5d482d2dd211e53720cdca27b0e98eec274e56577d41906b92","src/bin/generate_layout.rs":"e1df742c318ba4de09a25edad082a398da1d5591ac24074f9eadf3f40d677a9a","src/bin/generate_likelysubtags.rs":"c38ef8e59044578e51681723dbaf7f9669ccb7c7487f24ef6a430aad194f160f","src/errors.rs":"091525fd3d704cc4698bab82af9fff1f2e6fc793910700790ec3ef943b3eddfe","src/layout_table.rs":"c311b5399a22efd69f14decb00aee7dfb2943a090832e2aef127e2853ad1ce0b","src/lib.rs":"75b5e8958ba0139ef60139e61441d29c80bde8552d1adead3905165c11ed97cd","src/likelysubtags/mod.rs":"66889568b883675465faa445e257b4b70e9dcba98c6c523eb34a08ebb50377c0","src/likelysubtags/tables.rs":"47ab40497145adc553f9f585d1ec79d01028495a57b1907392642afd26986e89","src/parser/errors.rs":"2dacf5bf388499c9fbecf64ef950038f123335e87b6691bcdb88d185678f38d5","src/parser/mod.rs":"30f9ff487ab7b023ec7e6cfbfe4f4ebc41ca524cef0eba96a6b77ad624c9f6b8","src/serde.rs":"2ce1fdea1217c4f72b2c8e00f333902ff496c54eef5b4534adb289375c50aef0","src/subtags/language.rs":"1f7dbc4a10b58a6d1b729dc986a20396ce75558dfb1f9be223d5723a5e241e73","src/subtags/mod.rs":"ba23712d7ce5e0fa896c97ddc91d7eacbf21a99d62c15f5cf19a6653876bf56b","src/subtags/region.rs":"8cfd794f41f48fdf9742c9149b7360ea7cbd84c93abd13fe5a5317c46b4c48fc","src/subtags/script.rs":"94760b06f50f8f32c45af4f238b66e32428e5710ce4eabab4c943b5ebda3b0fe","src/subtags/variant.rs":"a8647d82c49df0d8df7fda33033d0df7a235beecfb35f459122675ab16b2dd8e"},"package":"1a4a8eeaf0494862c1404c95ec2f4c33a2acff5076f64314b465e3ddae1b934d"} \ No newline at end of file +{"files":{"Cargo.lock":"980c61883246a9d25408a3169b6c26c04b2f7da8de59d257554028106e366a65","Cargo.toml":"c2a408683e4da250c26db70cd4f8716956001e324e61e08e839d11eddc041971","README.md":"1ce686b1ba46e7fff771db934d1e8905e3d96c73d9e6712ca85011cf63cf4157","benches/canonicalize.rs":"c843af6b55c94dfd3233375435870e05c6c4090afffb3ec2901fb0d9e9b93800","benches/langid.rs":"096ab3acc302fa4f075b0a9df867f1d4434bc616d8eaf1a31643364610b6f375","benches/likely_subtags.rs":"672b47687d20d4294e2de78dc6eb1d36400a4b4c672082d15415fb18faf2e508","benches/parser.rs":"f9cf158bf5d146ef413e63e952c0a866269ba2be0db44a0aa88a5e61fdf53b4a","src/bin/generate_layout.rs":"a73c15b4997d4475298f6ff20a043e3e19bdbaa409b678442de7e2f949f18731","src/bin/generate_likelysubtags.rs":"17b94d689d6634cda7a169f54beef456540389148f036890fece63cf5c23835f","src/errors.rs":"091525fd3d704cc4698bab82af9fff1f2e6fc793910700790ec3ef943b3eddfe","src/layout_table.rs":"9e9baf9fb59516c4a55058a5ee7703c87e604bfc07b3b54b157557eef2f93bf4","src/lib.rs":"9649494f95f171179f7c5fc28a777a5f7e2c8a24a98d4d1b3751c84b7f386237","src/likelysubtags/mod.rs":"e9c670628274a7a8e7e5dda32aa52e610e8500054c28beea7f87296d9850a4bc","src/likelysubtags/tables.rs":"47ab40497145adc553f9f585d1ec79d01028495a57b1907392642afd26986e89","src/parser/errors.rs":"2dacf5bf388499c9fbecf64ef950038f123335e87b6691bcdb88d185678f38d5","src/parser/mod.rs":"55ce8c0444841b67c5c4e376ae0d2867859805752a0ed6bfe07593715695bc2e","src/subtags.rs":"2436c8492a7360cd8a5552973ed3a8521baa1e9f94760f03b56881f0703d1cac","tests/canonicalize_test.rs":"5ca005223ae159c15f8809c28c1cc950dc4d69063d9de70b885f18ef8e6cca28","tests/fixtures.rs":"f169a7b7aaeaf0a4611bdb24491f2033461ee21b8e405528e3b5fa91a4d73658","tests/fixtures/parsing.json":"7e0736376d8642d6eb16a451914ec7cff105d11640aa245efa92d9082e2be75b","tests/language_identifier_test.rs":"fadf326a8072324be4e74366ab57d0d6d20a0f4830bf122676d3448946304381","tests/likelysubtags.rs":"2f38668132de720af9769837010101127ed27d27d19b0bc74635b5caa94196b4"},"package":"c43c61e94492eb67f20facc7b025778a904de83d953d8fcb60dd9adfd6e2d0ea"} \ No newline at end of file diff --git a/third_party/rust/unic-langid-impl/Cargo.lock b/third_party/rust/unic-langid-impl/Cargo.lock index 55cc35bac670..97dcc5edc12d 100644 --- a/third_party/rust/unic-langid-impl/Cargo.lock +++ b/third_party/rust/unic-langid-impl/Cargo.lock @@ -1,602 +1,676 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +[[package]] +name = "anyhow" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "atty" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", - "libc", - "winapi", + "hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "autocfg" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" [[package]] name = "bitflags" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bstr" -version = "0.2.12" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2889e6d50f394968c8bf4240dc3f2a7eb4680844d27308f798229ac9d4725f41" dependencies = [ - "lazy_static", - "memchr", - "regex-automata", - "serde", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "bumpalo" -version = "3.2.1" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ae9db68ad7fac5fe51304d20f016c911539251075a214f8e663babefa35187" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "cast" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" dependencies = [ - "rustc_version", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cfg-if" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "clap" version = "2.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" dependencies = [ - "bitflags", - "textwrap", - "unicode-width", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "criterion" -version = "0.3.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63f696897c88b57f4ffe3c69d8e1a0613c7d0e6c4833363c8560fbde9c47b966" dependencies = [ - "atty", - "cast", - "clap", - "criterion-plot", - "csv", - "itertools", - "lazy_static", - "num-traits", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion-plot 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "oorandom 11.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "plotters 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", + "tinytemplate 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "criterion-plot" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddeaf7989f00f2e1d871a26a110f3ed713632feac17f65f03ca938c542618b60" dependencies = [ - "cast", - "itertools", + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-deque" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", - "maybe-uninit", + "crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-epoch" -version = "0.8.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "lazy_static", - "maybe-uninit", - "memoffset", - "scopeguard", + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-queue" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" dependencies = [ - "cfg-if", - "crossbeam-utils", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-utils" -version = "0.7.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "autocfg", - "cfg-if", - "lazy_static", + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "csv" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" dependencies = [ - "bstr", - "csv-core", - "itoa", - "ryu", - "serde", + "bstr 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "csv-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "csv-core" -version = "0.1.10" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" dependencies = [ - "memchr", + "memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "either" version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" + +[[package]] +name = "heck" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "hermit-abi" -version = "0.1.12" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61565ff7aaace3525556587bd2dc31d4a07071957be715e63ce7b1eccf51a8f4" dependencies = [ - "libc", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "itertools" -version = "0.9.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" dependencies = [ - "either", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "itoa" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" [[package]] name = "js-sys" -version = "0.3.39" +version = "0.3.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa5a448de267e7358beaf4a5d849518fe9a0c13fce7afd44b06e68550e5562a7" dependencies = [ - "wasm-bindgen", + "wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.69" +version = "0.2.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" [[package]] name = "log" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" dependencies = [ - "cfg-if", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - [[package]] name = "memchr" -version = "2.3.3" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +dependencies = [ + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "memoffset" -version = "0.5.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" dependencies = [ - "autocfg", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nom" +version = "4.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" dependencies = [ - "autocfg", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" dependencies = [ - "hermit-abi", - "libc", + "hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "oorandom" -version = "11.1.1" +version = "11.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94af325bc33c7f60191be4e2c984d48aaa21e2854f473b85398344b60c9b6358" [[package]] name = "plotters" -version = "0.2.14" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9b1d9ca091d370ea3a78d5619145d1b59426ab0c9eedbad2514a4cee08bf389" dependencies = [ - "js-sys", - "num-traits", - "wasm-bindgen", - "web-sys", + "js-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "proc-macro2" -version = "1.0.12" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8872cf6f48eee44265156c111456a700ab3483686b3f96df4cf5481c89157319" dependencies = [ - "unicode-xid", + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quote" -version = "1.0.4" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c1f4b0efa5fc5e8ceb705136bfee52cfdb6a4e3509f770b478cd6ed434232a7" dependencies = [ - "proc-macro2", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rayon" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" dependencies = [ - "crossbeam-deque", - "either", - "rayon-core", + "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rayon-core" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" dependencies = [ - "crossbeam-deque", - "crossbeam-queue", - "crossbeam-utils", - "lazy_static", - "num_cpus", + "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex" -version = "1.3.7" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-automata" -version = "0.1.9" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" dependencies = [ - "byteorder", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.6.17" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" [[package]] name = "rustc_version" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ - "semver", + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ryu" -version = "1.0.4" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1" [[package]] name = "same-file" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ - "winapi-util", + "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ - "semver-parser", + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.106" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399" dependencies = [ - "serde_derive", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.106" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.52" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7894c8ed05b7a3a279aeb79025fdec1d3158080b75b98a08faf2806bb799edd" dependencies = [ - "itoa", - "ryu", - "serde", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "syn" -version = "1.0.18" +name = "sourcefile" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "syn" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "410a7488c0a728c7ceb4ad59b9567eb4053d02e8cc7f5c0e0eeeb39518369213" dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "textwrap" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" dependencies = [ - "unicode-width", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tinystr" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bac79c4b51eda1b090b1edebfb667821bbb51f713855164dc7cec2cb8ac2ba3" [[package]] name = "tinytemplate" -version = "1.0.4" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45e4bc5ac99433e0dcb8b9f309dd271a165ae37dde129b9e0ce1bfdd8bfe4891" dependencies = [ - "serde", - "serde_json", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "unic-langid-impl" -version = "0.9.0" +version = "0.8.0" dependencies = [ - "criterion", - "serde", - "serde_json", - "tinystr", + "criterion 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", + "tinystr 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "unicode-segmentation" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicode-width" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" [[package]] name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" + +[[package]] +name = "version_check" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "walkdir" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" dependencies = [ - "same-file", - "winapi", - "winapi-util", + "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen" -version = "0.2.62" +version = "0.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c7d40d09cdbf0f4895ae58cf57d92e1e57a9dd8ed2e8390514b54a47cc5551" dependencies = [ - "cfg-if", - "wasm-bindgen-macro", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.62" +version = "0.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3972e137ebf830900db522d6c8fd74d1900dcfc733462e9a12e942b00b4ac94" dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", + "bumpalo 3.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.62" +version = "0.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cd85aa2c579e8892442954685f0d801f9129de24fa2136b2c6a539c76b65776" dependencies = [ - "quote", - "wasm-bindgen-macro-support", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro-support 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.62" +version = "0.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb197bd3a47553334907ffd2f16507b4f4f01bbec3ac921a7719e0decdfe72a" dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.62" +version = "0.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91c2916119c17a8e316507afaaa2dd94b47646048014bbdf6bef098c1bb58ad" + +[[package]] +name = "wasm-bindgen-webidl" +version = "0.2.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "weedle 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "web-sys" -version = "0.3.39" +version = "0.3.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bc359e5dd3b46cb9687a051d50a2fdd228e4ba7cf6fcf861a5365c3d671a642" dependencies = [ - "js-sys", - "wasm-bindgen", + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", + "sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-webidl 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "weedle" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "winapi" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[metadata] +"checksum anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)" = "7825f6833612eb2414095684fcf6c635becf3ce97fe48cf6421321e93bfbd53c" +"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +"checksum bstr 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "fe8a65814ca90dfc9705af76bb6ba3c6e2534489a72270e797e603783bb4990b" +"checksum bumpalo 3.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5fb8038c1ddc0a5f73787b130f4cc75151e96ed33e417fde765eb5a81e3532f4" +"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" +"checksum cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" +"checksum criterion 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1fc755679c12bda8e5523a71e4d654b6bf2e14bd838dfc48cde6559a05caf7d1" +"checksum criterion-plot 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a01e15e0ea58e8234f96146b1f91fa9d0e4dd7a38da93ff7a75d42c0b9d3a545" +"checksum crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" +"checksum crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" +"checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" +"checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" +"checksum csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" +"checksum csv-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9b5cadb6b25c77aeff80ba701712494213f4a8418fcda2ee11b6560c3ad0bf4c" +"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" +"checksum hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eff2656d88f158ce120947499e971d743c05dbcbed62e5bd2f38f1698bbc3772" +"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +"checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" +"checksum js-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)" = "7889c7c36282151f6bf465be4700359318aef36baa951462382eae49e9577cf9" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" +"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +"checksum memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3197e20c7edb283f87c071ddfc7a2cca8f8e0b888c242959846a6fce03c72223" +"checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" +"checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" +"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +"checksum num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6" +"checksum oorandom 11.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ebcec7c9c2a95cacc7cd0ecb89d8a8454eca13906f6deb55258ffff0adeb9405" +"checksum plotters 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "4e3bb8da247d27ae212529352020f3e5ee16e83c0c258061d27b08ab92675eeb" +"checksum proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3acb317c6ff86a4e579dfa00fc5e6cca91ecbb4e7eb2df0468805b674eb88548" +"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" +"checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" +"checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" +"checksum regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b5508c1941e4e7cb19965abef075d35a9a8b5cdf0846f30b4050e9b55dc55e87" +"checksum regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "92b73c2a1770c255c240eaa4ee600df1704a38dc3feaa6e949e7fcd4f8dc09f9" +"checksum regex-syntax 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e734e891f5b408a29efbf8309e656876276f49ab6a6ac208600b4419bd893d90" +"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" +"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" +"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" +"checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" +"checksum serde_json 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)" = "eab8f15f15d6c41a154c1b128a22f2dfabe350ef53c40953d84e36155c91192b" +"checksum sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf77cb82ba8453b42b6ae1d692e4cdc92f9a47beaf89a847c8be83f4e328ad3" +"checksum syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "af6f3550d8dff9ef7dc34d384ac6f107e5d31c8f57d9f28e0081503f547ac8f5" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum tinystr 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4bac79c4b51eda1b090b1edebfb667821bbb51f713855164dc7cec2cb8ac2ba3" +"checksum tinytemplate 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "57a3c6667d3e65eb1bc3aed6fd14011c6cbc3a0665218ab7f5daf040b9ec371a" +"checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" +"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" +"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" +"checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +"checksum wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "5205e9afdf42282b192e2310a5b463a6d1c1d774e30dc3c791ac37ab42d2616c" +"checksum wasm-bindgen-backend 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "11cdb95816290b525b32587d76419facd99662a07e59d3cdb560488a819d9a45" +"checksum wasm-bindgen-macro 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "574094772ce6921576fb6f2e3f7497b8a76273b6db092be18fc48a082de09dc3" +"checksum wasm-bindgen-macro-support 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "e85031354f25eaebe78bb7db1c3d86140312a911a106b2e29f9cc440ce3e7668" +"checksum wasm-bindgen-shared 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "f5e7e61fc929f4c0dddb748b102ebf9f632e2b8d739f2016542b4de2965a9601" +"checksum wasm-bindgen-webidl 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "ef012a0d93fc0432df126a8eaf547b2dce25a8ce9212e1d3cbeef5c11157975d" +"checksum web-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)" = "aaf97caf6aa8c2b1dac90faf0db529d9d63c93846cca4911856f78a83cebf53b" +"checksum weedle 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bb43f70885151e629e2a19ce9e50bd730fd436cfd4b666894c9ce4de9141164" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/third_party/rust/unic-langid-impl/Cargo.toml b/third_party/rust/unic-langid-impl/Cargo.toml index 6431f4c58aa5..31208efb1733 100644 --- a/third_party/rust/unic-langid-impl/Cargo.toml +++ b/third_party/rust/unic-langid-impl/Cargo.toml @@ -13,9 +13,9 @@ [package] edition = "2018" name = "unic-langid-impl" -version = "0.9.0" +version = "0.8.0" authors = ["Zibi Braniecki "] -include = ["src/**/*", "benches/*.rs", "Cargo.toml", "README.md"] +exclude = ["data/*"] description = "API for managing Unicode Language Identifiers" readme = "README.md" categories = ["internationalization"] diff --git a/third_party/rust/unic-langid-impl/benches/canonicalize.rs b/third_party/rust/unic-langid-impl/benches/canonicalize.rs index a9e17e49aa1f..c13dae8fa438 100644 --- a/third_party/rust/unic-langid-impl/benches/canonicalize.rs +++ b/third_party/rust/unic-langid-impl/benches/canonicalize.rs @@ -7,20 +7,6 @@ use unic_langid_impl::canonicalize; fn langid_canonicalize_bench(c: &mut Criterion) { let strings = &[ - "En_uS", - "EN-GB", - "ES-aR", - "iT", - "zH_HaNs_cN", - "dE-aT", - "Pl", - "FR-FR", - "de_AT", - "sR-CyrL_sr", - "NB-NO", - "fr_fr", - "Mk", - "uK", "en-us", "en_gb", "ES-AR", diff --git a/third_party/rust/unic-langid-impl/benches/langid.rs b/third_party/rust/unic-langid-impl/benches/langid.rs index 026c288602fb..d752dbd0dbbe 100644 --- a/third_party/rust/unic-langid-impl/benches/langid.rs +++ b/third_party/rust/unic-langid-impl/benches/langid.rs @@ -4,7 +4,7 @@ use criterion::criterion_main; use criterion::Criterion; use criterion::Fun; -use unic_langid_impl::subtags; +use tinystr::{TinyStr4, TinyStr8}; use unic_langid_impl::LanguageIdentifier; static STRINGS: &[&str] = &[ @@ -22,13 +22,6 @@ static STRINGS: &[&str] = &[ "fr-FR", "mk", "uk", - "en-US", - "en-GB", - "es-AR", - "th", - "de", - "zh-Cyrl-HN", - "en-Latn-US", ]; fn language_identifier_construct_bench(c: &mut Criterion) { @@ -54,27 +47,54 @@ fn language_identifier_construct_bench(c: &mut Criterion) { }) }), Fun::new("from_parts", |b, langids: &Vec| { - let entries: Vec<( - subtags::Language, - Option, - Option, - Vec, - )> = langids - .iter() - .cloned() - .map(|langid| langid.into_parts()) - .collect(); + let entries: Vec<(Option<&str>, Option<&str>, Option<&str>, Vec<&str>)> = + langids + .iter() + .map(|langid| { + let lang = Some(langid.language()).and_then(|s| { + if s == "und" { + None + } else { + Some(s) + } + }); + ( + lang, + langid.script(), + langid.region(), + langid.variants().collect::>(), + ) + }) + .collect(); b.iter(|| { for (language, script, region, variants) in &entries { - let _ = LanguageIdentifier::from_parts( - language.clone(), - script.clone(), - region.clone(), - variants, - ); + let _ = LanguageIdentifier::from_parts(*language, *script, *region, variants); } }) }), + Fun::new( + "from_parts_unchecked", + |b, langids: &Vec| { + let entries = langids + .iter() + .map(|langid| langid.clone().into_raw_parts()) + .collect::>(); + b.iter(|| { + for (language, script, region, variants) in &entries { + let _ = LanguageIdentifier::from_raw_parts_unchecked( + language.map(|l| unsafe { TinyStr8::new_unchecked(l) }), + script.map(|s| unsafe { TinyStr4::new_unchecked(s) }), + region.map(|r| unsafe { TinyStr4::new_unchecked(r) }), + variants.as_ref().map(|v| { + v.into_iter() + .map(|v| unsafe { TinyStr8::new_unchecked(*v) }) + .collect() + }), + ); + } + }) + }, + ), ]; c.bench_functions("language_identifier_construct", funcs, langids); diff --git a/third_party/rust/unic-langid-impl/data/cldr-misc-full/README.md b/third_party/rust/unic-langid-impl/data/cldr-misc-full/README.md deleted file mode 100644 index 68cb05255946..000000000000 --- a/third_party/rust/unic-langid-impl/data/cldr-misc-full/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# cldr-misc-full - -This repository provides the a portion of the JSON distribution of CLDR locale data -for internationalization. - -Refer to the README at https://github.com/unicode-cldr/cldr-json for complete details. diff --git a/third_party/rust/unic-langid-impl/src/bin/generate_layout.rs b/third_party/rust/unic-langid-impl/src/bin/generate_layout.rs index 35d8e27aed4d..78a26b09ddc6 100644 --- a/third_party/rust/unic-langid-impl/src/bin/generate_layout.rs +++ b/third_party/rust/unic-langid-impl/src/bin/generate_layout.rs @@ -1,8 +1,8 @@ use serde_json::Value; use std::collections::HashMap; -use std::collections::HashSet; use std::fs; -use unic_langid_impl::subtags::{Language, Script}; +use std::str::FromStr; +use tinystr::TinyStr8; use unic_langid_impl::CharacterDirection; use unic_langid_impl::LanguageIdentifier; @@ -37,94 +37,48 @@ fn langid_to_direction_map(path: &str) -> HashMap, - lang: Option, - script: Option