This function is used to look up a translation tag in dictionaries, and return the translation into the current
language. If no translation into the current language can be found, english will be tried, and if that fails,
placeholder text will be returned.
An array can be passed as the tag. In that case, the array will be assumed to be on the form (language => text),
and will be used as the source of translations.
This function can also do replacements into the translated tag. It will search the translated tag for the keys
provided in $replacements, and replace any found occurrences with the value of the key.
public t ( string | array $tag, array $replacements = [], boolean $fallbackdefault = true, $oldreplacements = [], $striptags = false ) : string | ||
$tag | string | array | A tag name for the translation which should be looked up, or an array with (language => text) mappings. The array version will go away in 2.0 |
$replacements | array | An associative array of keys that should be replaced with values in the translated string. |
$fallbackdefault | boolean | Default translation to use as a fallback if no valid translation was found. |
Résultat | string | The translated tag, or a placeholder value if the tag wasn't found. |