Skip to main content

t

Macro t 

Source
t!() { /* proc-macro */ }
Expand description

Translates a localisation key using the i18n runtime.

ยงSyntax

t!(i18n, "key")
t!(i18n, "key", name = expr, count = expr)

The first argument is an expression that resolves to the i18n context (typically an I18n value extracted from a handler parameter). The second argument is a string literal key. Additional name = value pairs are substituted into the translation string.

When a count variable is present the macro calls .t_plural instead of .t to select the correct plural form.

Requires the i18n feature on modo.