t()
Returns translate string for key from translation file
Parameters
Name | Type | Default |
---|---|---|
$key * | array |string |
– |
$fallback | string |null |
null |
$locale | string |null |
null |
Return type
Closure
|array
|string
|null
Examples
The t()
helper returns a predefined translation string by key.
Translations can be defined in the language files or in plugins.
Get a translation string by key:
Use a fallback value if no translation exists:
Force a particular locale: