Struct i18n_embed::gettext::GettextLanguageLoader[][src]

pub struct GettextLanguageLoader { /* fields omitted */ }
Expand description

LanguageLoader implementation for the gettext localization system.

⚠️ This API requires the following crate features to be activated: gettext-system.

Implementations

Create a new GettextLanguageLoader.

Example

use i18n_embed::gettext::GettextLanguageLoader;

GettextLanguageLoader::new(module_path!(), "en".parse().unwrap());

Trait Implementations

Formats the value using the given formatter. Read more

The fallback language for the module this loader is responsible for.

The domain for the translation that this loader is associated with.

The language file name to use for this loader’s domain.

Get the language which is currently loaded for this loader.

Load the languages language_ids using the resources packaged in the i18n_assets in order of fallback preference. This also sets the LanguageLoader::current_language() to the first in the language_ids slice. You can use select() to determine which fallbacks are actually available for an arbitrary slice of preferences.

Note: Gettext doesn’t support loading multiple languages as multiple fallbacks. We only load the first of the requested languages, and the fallback is the src language.

The computed path to the language file, and Cow of the file itself if it exists. Read more

Calculate the languages which are available to be loaded.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.