From 848a66835842d4c13e7bc852fae4d5c5ac6eddad Mon Sep 17 00:00:00 2001 From: Robert Bastian <4706271+robertbastian@users.noreply.github.com> Date: Thu, 21 Mar 2024 18:10:43 +0100 Subject: [PATCH 1/4] cf --- .../cldr/cldr_serde/parent_locales.rs | 1 + .../src/transform/cldr/fallback/mod.rs | 37 ------------ .../src/transform/icuexport/collator/mod.rs | 60 +++++++++++++++++++ 3 files changed, 61 insertions(+), 37 deletions(-) diff --git a/provider/datagen/src/transform/cldr/cldr_serde/parent_locales.rs b/provider/datagen/src/transform/cldr/cldr_serde/parent_locales.rs index d013193ed08..8716e58d9e1 100644 --- a/provider/datagen/src/transform/cldr/cldr_serde/parent_locales.rs +++ b/provider/datagen/src/transform/cldr/cldr_serde/parent_locales.rs @@ -15,6 +15,7 @@ use std::collections::HashMap; pub struct ParentLocales { #[serde(rename = "parentLocale")] pub parent_locale: HashMap, + pub collations: HashMap, } #[derive(PartialEq, Debug, Deserialize)] diff --git a/provider/datagen/src/transform/cldr/fallback/mod.rs b/provider/datagen/src/transform/cldr/fallback/mod.rs index 60a3b75c8fa..7ade9f41e64 100644 --- a/provider/datagen/src/transform/cldr/fallback/mod.rs +++ b/provider/datagen/src/transform/cldr/fallback/mod.rs @@ -6,8 +6,6 @@ use crate::transform::cldr::cldr_serde; use super::locale_canonicalizer::likely_subtags::LikelySubtagsResources; use icu_locid::{ - extensions::unicode::{key, Key}, - langid, subtags::{Language, Region, Script}, LanguageIdentifier, }; @@ -53,35 +51,6 @@ impl DataProvider for crate::DatagenProvider { } } -impl DataProvider for crate::DatagenProvider { - fn load( - &self, - req: DataRequest, - ) -> Result, DataError> { - self.check_req::(req)?; - // TODO(#1964): Load this data from its proper sources. For now, it is copied from: - // https://github.com/unicode-org/icu/blob/main/tools/cldr/cldr-to-icu/build-icu-data.xml - // as well as from CLDR XML. - #[allow(clippy::type_complexity)] - let parents_list: [(&UnvalidatedStr, (Language, Option