[−][src]Macro json_gettext::get_text
Used for getting single or multiple text from context.
ⓘThis example is not tested
#[macro_use] extern crate json_gettext; let ctx = static_json_gettext_build!( "en_US", "en_US", "langs/en_US.json", "zh_TW", "langs/zh_TW.json" ) .unwrap(); assert_eq!("Hello, world!", get_text!(ctx, "hello").unwrap()); assert_eq!("哈囉,世界!", get_text!(ctx, "zh_TW", "hello").unwrap());