dioxus_std/i18n/tanslate.rs
1#[macro_export]
2macro_rules! translate {
3 ( $i18:expr, $id:expr, $( $name:ident : $value:expr ),* ) => {
4 {
5 let mut params_map = std::collections::HashMap::new();
6 $(
7 params_map.insert(stringify!($name), $value.to_string());
8 )*
9 $i18.translate_with_params($id, params_map)
10 }
11 };
12
13 ( $i18:expr, $id:expr ) => {
14 {
15 $i18.translate($id)
16 }
17 };
18}