Skip to main content

translate

Function translate 

Source
pub fn translate(key: &str, locale: Option<&str>) -> String
Expand description

Helper to translate a message.

Falls back to the message key if no translation is found.

§Arguments

  • key - The message key (e.g. “validation.email.invalid”)
  • locale - The locale to use (e.g. “en”, “tr”). If None, uses default.