Macro gettext_macros::include_i18n
source · [−]include_i18n!() { /* proc-macro */ }
Expand description
Use this macro to staticaly import translations into your final binary.
This macro won’t work if ou set mo = false
in init_i18n
, unless you manually generate the .mo
files in
target/TARGET/gettext_macros/LOCALE/DOMAIN.mo
.
Example
ⓘ
let catalogs = include_i18n!();
catalog.into_iter()
.find(|(lang, _)| lang == "eo")
.map(|(_, catalog| println!("{}", i18n!(catalog, "Hello world!")));