Updating to use https://github.com/unicode-org/icu4x/pull/6158, which has the slightly unfortunate side effect of pinning all ICU4X crates to main
to keep types in sync
GJMBIJOE47X7DKZDHIY6VQ2ISC52XAVAV46L6PJQZTV7L7DDSWOAC
XGRU7WZEM6PTUCSHUA6QGNK7N34M7OPE52BTDC33BHSUEWM6B4FAC
HHJDRLLNN36UNIA7STAXEEVBCEMPJNB7SJQOS3TJLLYN4AEZ4MHQC
UN2XEIEUIB4ERS3IXOHQT2GCPBKK3JKHCGEVKQFP4SCV5AONFXMQC
3NMKD6I57ONAGHEN4PZIAV2KPYESVR4JL3DTWSHXKCMVJBEQ4GIQC
7M4UI3TWQIAA333GQ577HDWDWZPSZKWCYG556L6SBRLB6SZDQYPAC
VQBJBFEXRTJDBH27SVWRBCBFC7OOFOZ3DSMX7PE5BIZQLGHPVDYAC
VZYZRAO4EXCHW2LBVFG5ELSWG5SCNDREMJ6RKQ4EKQGI2T7SD3ZQC
UKFEFT6LSI4K7X6UHQFZYD52DILKXMZMYSO2UYS2FCHNPXIF4BEQC
let requested_locales = Self::old_locale_version(get_locales());
let system_locales = env_preferences::get_locales_lossy()
.map_err(|error| LocalizationError::RetrievalError(error))?;
// Lossily convert from a Locale to LanguageIdentifier for Fluent language negotiation
let system_langids = system_locales
.into_iter()
.map(|icu_locale| icu_locale.id)
.collect::<Vec<icu_locale_core::LanguageIdentifier>>();
let requested_locales = Self::old_locale_version(system_langids);
#[cfg(target_os = "linux")]
// TODO: does not add `-u-va-posix` extension, see https://unicode.org/reports/tr35/tr35.html#Legacy_Variants
pub fn get_locales() -> Vec<LanguageIdentifier> {
let mut retrieved_locales = env_preferences::get_locales().unwrap();
let locale_order = vec![
retrieved_locales.remove(&LocaleCategory::All),
retrieved_locales.remove(&LocaleCategory::Messages),
std::env::var("LANG").ok(),
];
locale_order
.into_iter()
.filter_map(|optional_locale| optional_locale)
.filter_map(|locale| LanguageIdentifier::try_from_str(&locale).ok())
.collect()
}
#[cfg(any(target_os = "macos", target_os = "windows"))]
pub fn get_locales() -> Vec<LanguageIdentifier> {
env_preferences::get_locales()
.unwrap()
.map(|locale| LanguageIdentifier::try_from_str(locale).unwrap())
.collect()
}
icu_decimal = { git = "https://github.com/unicode-org/icu4x", tag = "icu@2.0.0-beta2" }
icu_experimental = { git = "https://github.com/unicode-org/icu4x", tag = "icu@2.0.0-beta2" }
icu_locale = { git = "https://github.com/unicode-org/icu4x", tag = "icu@2.0.0-beta2" }
icu_decimal = { git = "https://github.com/unicode-org/icu4x" }
icu_experimental = { git = "https://github.com/unicode-org/icu4x" }
icu_locale = { git = "https://github.com/unicode-org/icu4x" }
icu_locale_core = { git = "https://github.com/unicode-org/icu4x" }
icu_plurals = { git = "https://github.com/unicode-org/icu4x", tag = "icu@2.0.0-beta2" }
icu_provider = { git = "https://github.com/unicode-org/icu4x", tag = "icu@2.0.0-beta2" }
icu_plurals = { git = "https://github.com/unicode-org/icu4x" }
icu_provider = { git = "https://github.com/unicode-org/icu4x" }
[[package]]
name = "icu_casemap"
version = "2.0.0-beta2"
source = "git+https://github.com/unicode-org/icu4x#7e324251ca3b2dc6ba1cb870c6bedee549cb5d1b"
dependencies = [
"displaydoc",
"icu_casemap_data",
"icu_collections",
"icu_locale_core",
"icu_properties",
"icu_provider 2.0.0-beta2",
"potential_utf",
"writeable 0.6.1 (git+https://github.com/unicode-org/icu4x)",
"zerovec 0.11.1",
]
[[package]]
name = "icu_casemap_data"
version = "2.0.0-beta2"
source = "git+https://github.com/unicode-org/icu4x#7e324251ca3b2dc6ba1cb870c6bedee549cb5d1b"
source = "git+https://github.com/unicode-org/icu4x?tag=icu%402.0.0-beta2#450bb445e32149e2825a055b5ebd8490b4b6694b"
dependencies = [
"icu_locale",
"icu_provider_baked",
]
source = "git+https://github.com/unicode-org/icu4x#7e324251ca3b2dc6ba1cb870c6bedee549cb5d1b"
"writeable 0.6.1 (git+https://github.com/unicode-org/icu4x?tag=icu%402.0.0-beta2)",
"zerofrom 0.1.6 (git+https://github.com/unicode-org/icu4x?tag=icu%402.0.0-beta2)",
"writeable 0.6.1 (git+https://github.com/unicode-org/icu4x)",
"zerofrom 0.1.6 (git+https://github.com/unicode-org/icu4x)",
source = "git+https://github.com/unicode-org/icu4x?tag=icu%402.0.0-beta2#450bb445e32149e2825a055b5ebd8490b4b6694b"
dependencies = [
"icu_locale",
"icu_provider_baked",
]
source = "git+https://github.com/unicode-org/icu4x#7e324251ca3b2dc6ba1cb870c6bedee549cb5d1b"
source = "git+https://github.com/unicode-org/icu4x?tag=icu%402.0.0-beta2#450bb445e32149e2825a055b5ebd8490b4b6694b"
dependencies = [
"icu_locale",
"icu_provider_baked",
]
source = "git+https://github.com/unicode-org/icu4x#7e324251ca3b2dc6ba1cb870c6bedee549cb5d1b"
source = "git+https://github.com/unicode-org/icu4x?tag=icu%402.0.0-beta2#450bb445e32149e2825a055b5ebd8490b4b6694b"
dependencies = [
"icu_locale",
"icu_provider_baked",
]
source = "git+https://github.com/unicode-org/icu4x#7e324251ca3b2dc6ba1cb870c6bedee549cb5d1b"
"zerofrom 0.1.6 (git+https://github.com/unicode-org/icu4x?tag=icu%402.0.0-beta2)",
"zerovec 0.11.1",
]
[[package]]
name = "icu_provider_baked"
version = "2.0.0-beta2"
source = "git+https://github.com/unicode-org/icu4x?tag=icu%402.0.0-beta2#450bb445e32149e2825a055b5ebd8490b4b6694b"
dependencies = [
"icu_provider 2.0.0-beta2",
"writeable 0.6.1 (git+https://github.com/unicode-org/icu4x?tag=icu%402.0.0-beta2)",
"zerofrom 0.1.6 (git+https://github.com/unicode-org/icu4x)",
"windows-targets",
"windows-future",
"windows-link",
"windows-numerics",
]
[[package]]
name = "windows-collections"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5467f79cc1ba3f52ebb2ed41dbb459b8e7db636cc3429458d9a852e15bc24dec"
dependencies = [
"windows-core",
"windows-targets",
"windows-strings",
]
[[package]]
name = "windows-future"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a787db4595e7eb80239b74ce8babfb1363d8e343ab072f2ffe901400c03349f0"
dependencies = [
"windows-core",
"windows-link",
version = "0.1.2"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252"
dependencies = [
"windows-link",
]
[[package]]
name = "windows-strings"
version = "0.3.1"