Move `old_locale_version` hack out of `Localize` trait
Dependencies
- [2]
5I5NR4DQMake `Localize::CANONICAL_LOCALE` a function instead of associated constant - [3]
LU6IFZFGRemove `std::io::Write` trait bound from `Localize` - [4]
QJC4IQITRefactor `Localize` functions to infallibly return `String` - [5]
U2PHMYPDReturn `String` directly instead of writing to buffer in `Localize::localize` - [6]
UN2XEIEUMigrate from `locale_select` to `env_preferences` - [7]
GJMBIJOEMigrate to latest env_preferences version - [8]
HHJDRLLNCreate `fluent_embed_runtime` crate - [9]
7M4UI3TWUpdate dependencies to latest versions - [10]
3NMKD6I5Refactor `Localize` trait to use `std::io::Write`
Change contents
- edit in fluent_embed/src/lib.rs at line 27[2.1136]→[2.1136:1142](∅→∅),[2.1142]→[3.4956:4957](∅→∅),[3.2154]→[3.4956:4957](∅→∅),[3.4956]→[3.4956:4957](∅→∅),[3.4957]→[3.2871:2928](∅→∅),[3.2928]→[3.101:164](∅→∅),[3.164]→[3.2974:3145](∅→∅),[3.2974]→[3.2974:3145](∅→∅),[3.3145]→[3.165:219](∅→∅),[3.219]→[3.3199:3279](∅→∅),[3.3199]→[3.3199:3279](∅→∅),[3.3279]→[3.220:320](∅→∅),[3.320]→[3.3379:3440](∅→∅),[3.3379]→[3.3379:3440](∅→∅)
}// TODO: remove this hackfn old_locale_version(new_locales: Vec<icu_locale_core::LanguageIdentifier>,) -> Vec<icu_locid::LanguageIdentifier> {new_locales.into_iter()// Convert new `icu_locale::LanguageIdentifier` to canonical string.map(|icu_langid| icu_langid.to_string())// Convert canonical string to old `icu_locid` for `fluent_langneg`.map(|icu_langid| icu_locid::LanguageIdentifier::try_from_bytes(icu_langid.as_bytes())).map(Result::unwrap).collect::<_>() - replacement in fluent_embed/src/lib.rs at line 37
let requested_locales = Self::old_locale_version(system_langids);let available_locales = Self::old_locale_version(self.available_locales());let requested_locales = old_locale_version(system_langids);let available_locales = old_locale_version(self.available_locales()); - edit in fluent_embed/src/lib.rs at line 55
}// TODO: remove this hackfn old_locale_version(new_locales: Vec<icu_locale_core::LanguageIdentifier>,) -> Vec<icu_locid::LanguageIdentifier> {new_locales.into_iter()// Convert new `icu_locale::LanguageIdentifier` to canonical string.map(|icu_langid| icu_langid.to_string())// Convert canonical string to old `icu_locid` for `fluent_langneg`.map(|icu_langid| icu_locid::LanguageIdentifier::try_from_bytes(icu_langid.as_bytes())).map(Result::unwrap).collect::<_>()