[][src]Crate localizer

Simple library for localization.

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"));

Re-exports

pub use constants::STD_PATH;
pub use structs::Localizer;

Modules

constants
enums
structs

Functions

change_localizer

changes language, dictionary, etc

get_by_key

returns value from dictionary if it exists otherwise returns None

get_by_key1

returns value from dictionary if it exists otherwise returns key

get_by_key2

returns value from dictionary if it exists otherwise returns second parameter

into_string
set_loc_string

changes string

set_localizer