Macro tiny_i18n::i18n

source ยท
i18n!() { /* proc-macro */ }
Expand description

This macro generates a module i18n which contains a macro per translation key, so it should be called at the top of your main file Example :

my_i18n_library::i18n!("path_of_the_translations_directory"); //defaults to `i18n` if called without argument

fn main() {
    // Each translation key generates a macro (every non-ASCII letter, number or underscore are removed)
    println!("{}", i18n::hello_world!("en-us")); //the first argument is the language, the following are the arguments, if any
}