1 unstable release
Uses old Rust 2015
0.1.2 | Feb 9, 2018 |
---|---|
0.1.1 |
|
0.1.0 |
|
0.0.1 |
|
#50 in #look
31 downloads per month
54KB
1.5K
SLoC
Deprecated
Consider https://github.com/projectfluent/fluent-rs instead.
lib.rs
:
L20n implementation for localization
This crate provides an interface to use l20n files to localize your application.
Example usage
extern crate l20n;
use std::collections::HashMap;
fn main() {
let mut locale = l20n::Locale::new();
locale.add_resource(r#"
<hi "Hello {{ $name }}!">
"#).unwrap();
let mut env = HashMap::new();
env.insert("name", "Rust");
let strs: HashMap<String, String> = locale.localize_data(env).unwrap();
assert_eq!(strs["hi"], "Hello Rust!");
}
Dependencies
~745KB
~15K SLoC