Crates.io | localize |
lib.rs | localize |
version | 0.2.0 |
source | src |
created_at | 2022-01-02 01:12:01.158848 |
updated_at | 2022-01-02 17:44:42.991999 |
description | Localization library |
homepage | |
repository | https://github.com/sy1ntexx/localize |
max_upload_size | |
id | 506368 |
size | 21,288 |
Simple library for localization purposes. Mainly for web development. Warning: Unsafe magic inside, not very much but still. Tests contributions are appreciated.
[dependencies]
localize = "0.1.0"
# Depend on master branch
# [dependencies.localize]
# git = "https://github.com/sy1ntexx/localize"
// 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!" }