pub mod compiler;
pub mod strings;
pub mod util;
pub mod buildscript;
pub mod locale_names;
#[cfg(test)]
#[allow(unused_imports)]
mod tests {
use super::*;
#[test]
fn strings() {
let mut s = strings::Strings::new("en_US", strings::Strings::find_locale_name("en_US"));
s.add_string("ui.hello", "Hello, World! ");
s.add_string("ui.cancel", "Cancel");
assert_eq!(s.get_lang_id(), "en_US");
assert_eq!(s.get_lang_name(), "English (United States)");
assert_eq!(s.translate("ui.hello"), "Hello, World! ");
assert_eq!(s.translate("key.not.exist"), "key.not.exist");
let bytes = compiler::compile(&s.jsonize()).unwrap();
let recov = strings::Strings::load(&bytes).unwrap();
assert_eq!(s.translate("ui.hello"), recov.translate("ui.hello"));
}
}