Skip to main content

t

Macro t 

Source
macro_rules! t {
    ($key:expr) => { ... };
    ($key:expr, { $($k:expr => $v:expr),* $(,)? }) => { ... };
}
Expand description

The primary accessor macro for localized strings.

It delegates to lookup_static or lookup_dynamic depending on whether arguments are provided.

§Examples

Basic usage:

let title = t!("app-title");

With arguments:

let welcome = t!("welcome-user", {
    "name" => "Alice",
    "unread_count" => 5
});