Crate localize[−][src]
Expand description
Localize
Simple library for localization purposes. Mainly for web development. Warning: Unsafe magic inside, not very much but still. Tests contributions are appreciated.
Installation
[dependencies]
localize = "0.1.0"
Usage
// locales/en.json
/*
{
"welcome": "Hello, World!"
}
*/
let localizer = Localizer::new("locales/").precache_all().debug(true);
let tag = String::from("en");
let output = localizer.localize(&tag).unwrap();
dbg!(output);
// output = { "welcome": "Hello, World!" }
Structs
Heart and soul of this crated. Intended to be initialized once.
Enums
For big and small mistakes.