Expand description
Simple library for localization.
§no unsafe code
§Example:
use localizer::*;
const langs_file : &str = "
[langs.ru]
\"ex1\" = \"ПРН{}\"
[langs.en]
\"ex1\" = \"IKA{}\"";
localizer::set_loc_string(langs_file);
//localizator::set_localizer(Localizer::create().file(None).current_lang(Some("ru".to_string())));
localizer::change_localizer(&|x|{x.set_current_lang(Some("ru".to_string()));});
println!("{:?}", localizer::get_by_key(&"ex1"));
let loc = Localizer::create().file(None).current_lang(Some("ru".to_string()));
println!("{:?}", loc.get(&"ex1"));
§Further examples:
cargo run –example %example%
§1:
§2:
§3:
Tic_Tac_Toe game1 Tic_Tac_Toe game2
§No-Std:
feature = “no_std”
§Cargo.toml:
localizer = {version = …, default-features = false, features = [“no_std”]}
Re-exports§
pub use structs::localizer::Localizer;
pub use error::Error;
pub use traits::FnUser;
pub use prelude::*;