Use default locale fallback data

This commit is contained in:
Robert Bastian 2025-08-28 09:48:54 +00:00
parent d82a20e025
commit 359cbd205f
10 changed files with 30 additions and 216 deletions

View file

@ -9,7 +9,6 @@ fluent-bundle = "0.16"
fluent-syntax = "0.12"
icu_list = { version = "2.0", default-features = false, features = ["alloc"] }
icu_locale = { version = "2.0", default-features = false }
icu_provider_adapters = "2.0"
intl-memoizer = "0.5.1"
rustc_ast = { path = "../rustc_ast" }
rustc_ast_pretty = { path = "../rustc_ast_pretty" }

View file

@ -567,18 +567,10 @@ pub fn fluent_value_from_str_list_sep_by_and(l: Vec<Cow<'_, str>>) -> FluentValu
where
Self: Sized,
{
let baked_data_provider = rustc_baked_icu_data::baked_data_provider();
let locale_fallbacker =
icu_locale::LocaleFallbacker::try_new_unstable(&baked_data_provider)
.expect("Failed to create fallback provider");
let data_provider = icu_provider_adapters::fallback::LocaleFallbackProvider::new(
baked_data_provider,
locale_fallbacker,
);
let locale = icu_locale_from_unic_langid(lang)
.unwrap_or_else(|| rustc_baked_icu_data::supported_locales::EN);
let list_formatter = icu_list::ListFormatter::try_new_and_unstable(
&data_provider,
&rustc_baked_icu_data::BakedDataProvider,
locale.into(),
icu_list::options::ListFormatterOptions::default()
.with_length(icu_list::options::ListLength::Wide),