r18n

Crates.ior18n
lib.rsr18n
version0.0.2
sourcesrc
created_at2015-03-13 18:11:41.783717
updated_at2015-12-11 23:55:29.371301
descriptionInternationalisation library for Rust
homepagehttps://github.com/pzol/r18n
repositoryhttps://github.com/pzol/r18n
max_upload_size
id1568
size6,382
Piotr Zolnierek (pzol)

documentation

https://github.com/pzol/r18n

README

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");

Links

Commit count: 2

cargo fmt