3 unstable releases
0.2.0 | Jan 2, 2022 |
---|---|
0.1.1 | Jan 2, 2022 |
0.1.0 | Jan 2, 2022 |
#201 in Internationalization (i18n)
14KB
251 lines
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"
# Depend on master branch
# [dependencies.localize]
# git = "https://github.com/sy1ntexx/localize"
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!" }
Dependencies
~0.8–9MB
~76K SLoC