Function t_with_args

Source
pub fn t_with_args(
    key: &'static str,
    message: &'static str,
    args: &[(&'static str, Arg<'_>)],
) -> Cow<'static, str>
Expand description

Translates a message with placeholder substitution.

Substitutes placeholders in the format {key} with provided argument values. Escaped braces {{ and }} are converted to literal { and }.

If a placeholder argument is not found, the placeholder is output as-is. If a placeholder is malformed (missing closing brace), the literal characters are output.

ยงArguments

  • key - Translation key for lookup (used only for translation retrieval)
  • message - Default message with placeholders
  • args - Slice of key-value pairs for substitution