[][src]Crate localizer

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

Re-exports

pub use constants::STD_PATH;
pub use structs::localizer::Localizer;
pub use enums::serialize_form;

Modules

constants
enums
structs

Traits

ContFormArgs
Display

Format trait for an empty format, {}.

Form
FormArg
FormTo
Res

Functions

change_localizer

changes language, dictionary, etc

finds
finds_all
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

get_by_key3

returns Vec of value from dictionary

into_string
set_loc_string

changes string

set_localizer