Crates.io | kalgan_i18n |
lib.rs | kalgan_i18n |
version | 0.9.1 |
source | src |
created_at | 2022-02-20 16:54:25.87308 |
updated_at | 2022-02-24 14:40:36.048239 |
description | A translation tool that retrieves the messages stored in yaml files used by Kalgan Framework. |
homepage | https://kalgan.eduardocasas.com |
repository | https://github.com/eduardocasas/kalgan-i18n |
max_upload_size | |
id | 535835 |
size | 13,211 |
A translation tool that retrieves the messages stored in yaml files used by Kalgan Framework.
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!");
For further information please visit:
This crate is licensed under either of the following licenses: