Struct l20n::Locale
[−]
[src]
pub struct Locale {
// some fields omitted
}A Locale contains all the resources for a specific language.
Methods
impl Locale
fn new() -> Locale
Creates a new empty Locale.
fn add_resource(&mut self, res: &str) -> Result<(), ParseError>
Add a L20n string resource, and it will be parsed.
fn localize<T: Deserialize>(&self) -> LocalizeResult<T>
Resolves all the resouces into Strings, and returns a Deserialize object of your choosing.
fn localize_data<T: Deserialize, D: Serialize>(&self, data: D) -> LocalizeResult<T>
Same as localize, but you provide environment Data for the L20n
files to use.