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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§