[−][src]Macro gettext_macros::include_i18n
include_i18n!() { /* proc-macro */ }
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
ⓘThis example is not tested
let catalogs = include_i18n!(); catalog.into_iter() .find(|(lang, _)| lang == "eo") .map(|(_, catalog| println!("{}", i18n!(catalog, "Hello world!")));