Skip to main content

Crate laterite_macros

Crate laterite_macros 

Source
Expand description

Translation-string macros.

t!, tn!, tp! build a laterite_core::i18n::Text at the call site. The source is a string literal (so extraction can collect it), its {name} placeholders are checked against the named arguments at compile time, and positional {} or format specs are rejected. For a non-literal source, use Text::dynamic.

Macrosยง

t
A translation message: t!("Save"), t!("Welcome, {name}", name = user.name).
tn
A pluralized message: tn!("{n} item", "{n} items", n = count). The n argument is the count the plural form is chosen from.
tp
A context-disambiguated message (homonyms): tp!("verb", "Open").