libappstream::prelude

Trait TranslationExt

source
pub trait TranslationExt:
    IsA<Translation>
    + Sealed
    + 'static {
    // Provided methods
    fn id(&self) -> Option<GString> { ... }
    fn kind(&self) -> TranslationKind { ... }
    fn source_locale(&self) -> Option<GString> { ... }
    fn set_id(&self, id: &str) { ... }
    fn set_kind(&self, kind: TranslationKind) { ... }
    fn set_source_locale(&self, locale: Option<&str>) { ... }
}
Expand description

Trait containing all Translation methods.

§Implementors

Translation

Provided Methods§

source

fn id(&self) -> Option<GString>

The ID (e.g. Gettext translation domain) of this translation.

source

fn kind(&self) -> TranslationKind

The translation system type.

§Returns

an enum of type TranslationKind

source

fn source_locale(&self) -> Option<GString>

The locale of the source strings for this component. If this has not been explicitly specified, en_US will be returned.

§Returns

The locale of the source strings for this component.

source

fn set_id(&self, id: &str)

Set the ID (e.g. Gettext domain) of this translation.

§id

The ID of this translation.

source

fn set_kind(&self, kind: TranslationKind)

Set the translation system type.

§kind

the new TranslationKind

source

fn set_source_locale(&self, locale: Option<&str>)

Set the locale of the source strings for this component. In gettext, this is referred to as the C locale. It’s almost always en_US, but for some components it may not be.

§locale

The POSIX locale that the source strings are in, or None if unknown or default.

Object Safety§

This trait is not object safe.

Implementors§