#deprecated #localization #github #look #com-projectfluent-fluent-rs

deprecated l20n

Deprecated l20n implementation. Look for https://github.com/projectfluent/fluent-rs instead.

1 unstable release

Uses old Rust 2015

0.1.2 Feb 9, 2018
0.1.1 Dec 16, 2015
0.1.0 Oct 18, 2015
0.0.1 May 12, 2015

#44 in #look

MIT license

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

~750KB
~15K SLoC