Trait Backend

Source
pub trait Backend:
    Send
    + Sync
    + 'static {
    // Required methods
    fn available_locales(&self) -> Vec<&str>;
    fn translate(&self, locale: &str, key: &str) -> Option<&str>;
}
Expand description

I18n backend trait

Required Methods§

Source

fn available_locales(&self) -> Vec<&str>

Return the available locales

Source

fn translate(&self, locale: &str, key: &str) -> Option<&str>

Get the translation for the given locale and key

Implementors§