[][src]Trait i18n_embed::LanguageLoader

pub trait LanguageLoader {
    fn src_locale(&self) -> LanguageIdentifier;
fn domain(&self) -> &'static str;
fn load_language_file(&self, file: Cow<[u8]>);
fn language_file_name(&self) -> String; }

A trait used by I18nEmbed to load a language file for a specific rust module using a specific localization system. The trait is designed such that the loader could be swapped during runtime, or contain state if required.

Required methods

fn src_locale(&self) -> LanguageIdentifier

The locale used in the source code for the module this loader is responsible for.

fn domain(&self) -> &'static str

The domain for the translation.

fn load_language_file(&self, file: Cow<[u8]>)

Load the language file corresponding to the module that this loader requested in module_path().

fn language_file_name(&self) -> String

Calculate the language file name to use for the given LanguageLoader.

Loading content...

Implementors

Loading content...