Trait tr::Translator[][src]

pub trait Translator: Send + Sync {
    fn translate<'a>(
        &'a self,
        string: &'a str,
        context: Option<&'a str>
    ) -> Cow<'a, str>;
fn ntranslate<'a>(
        &'a self,
        n: u64,
        singular: &'a str,
        plural: &'a str,
        context: Option<&'a str>
    ) -> Cow<'a, str>; }

This trait can be implemented by object that can provide a backend for the translation

The backend is only responsable to provide a matching string, the formatting is done using this string.

The translator for a crate can be set with the set_translator! macro

Required methods

fn translate<'a>(
    &'a self,
    string: &'a str,
    context: Option<&'a str>
) -> Cow<'a, str>
[src]

fn ntranslate<'a>(
    &'a self,
    n: u64,
    singular: &'a str,
    plural: &'a str,
    context: Option<&'a str>
) -> Cow<'a, str>
[src]

Loading content...

Implementors

Loading content...