cushy::localization

Trait LocalizationContext

source
pub trait LocalizationContext {
    // Required methods
    fn locale(&self) -> LanguageIdentifier;
    fn localizations(&self) -> &Localizations;
    fn invalidate_when_changed(&self, trackable: &impl Trackable);
}
Expand description

A context that is used while localizing values.

Required Methods§

source

fn locale(&self) -> LanguageIdentifier

Returns the current locale of this context.

source

fn localizations(&self) -> &Localizations

Returns the localizations for this context.

source

fn invalidate_when_changed(&self, trackable: &impl Trackable)

Invalidates trackable when changed.

Some values are localized outside of the context of a window being opened: for example, the Window’s title. In situations like these, invalidation is ignored.

Object Safety§

This trait is not object safe.

Implementors§