Skip to main content

Translate

Overview​

Substitutes the translation corresponding to the given key using the currently selected client-language while allowing to set placeholders in retrieved values as well as to provide a fallback if there was no value with the given key; this tag acts as a placeholder and must thereby be self-closing (does not accept content).

<translate, tr

  key: string

  ↪ Path of the value to render

  fallback: string(null)

  ↪ Fallback value to use if key is absent

  with: markup(null)

  ↪ Components rendered into placeholders

/>

Examples​

Simple Value​

Most values do not contain any placeholders, making for the simplest kind of translation.

Code-Blocks are only available within the browser

Requiring Placeholders​

Whenever placeholders are contained, specify them in the desired order; if values are missing, the client will not render the message.

Code-Blocks are only available within the browser

Key Shorthand​

For convenience, the Code-Blocks are only available within the browser attribute also supports a bound expression of arbitrary name, while all other attributes support bound expressions with matching names.

Code-Blocks are only available within the browser