Trait zng::l10n::L10nSource

source ·
pub trait L10nSource: Send + 'static {
    // Required methods
    fn available_langs(
        &mut self,
    ) -> Box<dyn VarBoxed<Arc<LangMap<HashMap<LangFilePath, PathBuf>>>>>;
    fn available_langs_status(
        &mut self,
    ) -> Box<dyn VarBoxed<LangResourceStatus>>;
    fn lang_resource(
        &mut self,
        lang: Lang,
        file: LangFilePath,
    ) -> Box<dyn VarBoxed<Option<ArcEq<FluentResource>>>>;
    fn lang_resource_status(
        &mut self,
        lang: Lang,
        file: LangFilePath,
    ) -> Box<dyn VarBoxed<LangResourceStatus>>;
}
Expand description

Represents a localization data source.

See L10N.load for more details.

Required Methods§

source

fn available_langs( &mut self, ) -> Box<dyn VarBoxed<Arc<LangMap<HashMap<LangFilePath, PathBuf>>>>>

Gets a read-only variable with all lang files that the source can provide.

source

fn available_langs_status(&mut self) -> Box<dyn VarBoxed<LangResourceStatus>>

Gets a read-only variable that is the status of the available_langs value.

source

fn lang_resource( &mut self, lang: Lang, file: LangFilePath, ) -> Box<dyn VarBoxed<Option<ArcEq<FluentResource>>>>

Gets a read-only variable that provides the fluent resource for the lang and file if available.

source

fn lang_resource_status( &mut self, lang: Lang, file: LangFilePath, ) -> Box<dyn VarBoxed<LangResourceStatus>>

Gets a read-only variable that is the status of the lang_resource value.

Implementors§