kalgan_i18n

Crates.iokalgan_i18n
lib.rskalgan_i18n
version0.9.1
sourcesrc
created_at2022-02-20 16:54:25.87308
updated_at2022-02-24 14:40:36.048239
descriptionA translation tool that retrieves the messages stored in yaml files used by Kalgan Framework.
homepagehttps://kalgan.eduardocasas.com
repositoryhttps://github.com/eduardocasas/kalgan-i18n
max_upload_size
id535835
size13,211
Eduardo Casas (eduardocasas)

documentation

README

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:

Commit count: 7

cargo fmt