Skip to main content

tr

Macro tr 

Source
macro_rules! tr {
    ($id:literal) => { ... };
    ($id:literal, $($name:ident = $value:expr),+ $(,)?) => { ... };
}
Available on crate feature i18n only.
Expand description

Look up a UI message, optionally with name = value arguments.

With the i18n feature this is a runtime Fluent lookup against LOADER; without it, the English text from the en catalog (generated at build time). Either way it returns a String and is fully qualified through $crate, so it works from any crate in the workspace without extra dependencies. Argument values only need to be Into<FluentValue> (with i18n) / Display (without) — String, &str, integers.