Crates.io | r18n |
lib.rs | r18n |
version | 0.0.2 |
source | src |
created_at | 2015-03-13 18:11:41.783717 |
updated_at | 2015-12-11 23:55:29.371301 |
description | Internationalisation library for Rust |
homepage | https://github.com/pzol/r18n |
repository | https://github.com/pzol/r18n |
max_upload_size | |
id | 1568 |
size | 6,382 |
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");
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");