cushy

Macro localize

source
macro_rules! localize {
    ($key:expr) => { ... };
    ($key:expr, $($name:expr => $arg:expr),*) => { ... };
}
Expand description

Returns a message localized in the current locale.

The first argument to this macro is the unique id/key of the message being localized. After the initial argument, the remaning arguments are expected to be name => value pairs.

use cushy::localize;

let message = localize!("welcome-message");

let message = localize!("welcome-message", "user" => "Ecton");

This macro always returns a Localize.