dioxus-i18n 0.2.3

i18n integration for Dioxus apps based on Fluent Project.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[macro_export]
macro_rules! translate {
    ( $i18n:expr, $id:expr, $( $name:ident : $value:expr ),* ) => {
        {
            let mut params_map = dioxus_i18n::fluent::FluentArgs::new();
            $(
                params_map.set(stringify!($name), $value);
            )*
            $i18n.translate_with_args($id, Some(&params_map))
        }
    };

    ( $i18n:expr, $id:expr ) => {
        {
            $i18n.translate($id)
        }
    };
}