#fra #tlc

nightly bin+lib r18n

Internationalisation library for Rust

2 releases

Uses old Rust 2015

0.0.2 Mar 17, 2015
0.0.1 Mar 13, 2015

#247 in Internationalization (i18n)

MIT/Apache

6KB
132 lines

r18n

Text t

extern crate r18n;
let toml = r#"
[tlc.FRA]
name = "Frankfurt"
"#;

let r : r18n::R18n = toml.parse().unwrap();
assert_eq!(r.t("tlc.FRA.name").unwrap(), "Frankfurt");

Count

extern crate r18n;
let toml = r#"
[pax]
guests = [
    "1 guest",
    "%d guests"
]
"#;

let r : r18n::R18n = toml.parse().unwrap();
assert_eq!(r.c("pax.guests", 1).unwrap(), "1 guest");
assert_eq!(r.c("pax.guests", 3).unwrap(), "3 guests");

Dependencies

~270–520KB
~11K SLoC