Implement `Localize` for `RelativeTime`
Dependencies
- [2]
7U2DXFMPRefactor `fluent_embed::Localize` to support overriding locales - [3]
BFL2Y7GNAdd relative timestamps using `jiff` and `icu_relativetime`
Change contents
- edit in fluent_embed/src/time.rs at line 1
use crate::Localize; - edit in fluent_embed/src/time.rs at line 23
const CANONICAL_LOCALE: LanguageIdentifier = DEFAULT_LOCALE; - edit in fluent_embed/src/time.rs at line 26
} - replacement in fluent_embed/src/time.rs at line 28
pub fn localize(&self) -> String {impl Localize for RelativeTime {const CANONICAL_LOCALE: LanguageIdentifier = DEFAULT_LOCALE;fn message_for_locale(&self, locale: &LanguageIdentifier) -> String { - replacement in fluent_embed/src/time.rs at line 89
// Select which formatter to uselet locale = DataLocale::from(&Self::CANONICAL_LOCALE);let locale = DataLocale::from(locale); - edit in fluent_embed/src/time.rs at line 107
fn localize(&self) -> String {// TODO: select locale based on environmentself.message_for_locale(&Self::CANONICAL_LOCALE)}