kalgan_i18n 0.9.1

A translation tool that retrieves the messages stored in yaml files used by Kalgan Framework.
Documentation

kalgan-i18n

A translation tool that retrieves the messages stored in yaml files used by Kalgan Framework.

Examples

This is the yaml file to be used in the following tests:

## tests/en/messages.yaml

hello:
  world: Hello World!
  somebody: Hello {user}!
use kalgan_i18n::Messages;

let messages: Messages = Messages::new("tests");
assert_eq!(messages.trans("en", "hello.world", HashMap::new()), "Hello World!");
let mut parameters = HashMap::new();
parameters.insert("user", "John".to_string());
assert_eq!(messages.trans("en", "hello.somebody", parameters), "Hello John!");

Documentation

For further information please visit:

License

This crate is licensed under either of the following licenses: