Macro tr::set_translator
source · macro_rules! set_translator { ($translator:expr) => { ... }; }
Expand description
Set the translator to be used for this crate.
The argument needs to be something implementing the Translator trait
For example, using the gettext crate (if the gettext feature is enabled)
ⓘ
let f = File::open("french.mo").expect("could not open the catalog");
let catalog = Catalog::parse(f).expect("could not parse the catalog");
set_translator!(catalog);