TranslateViewHelper extends AbstractViewHelper
This class is the implementation of a Fluid ViewHelper.
View this class in the TYPO3 ViewHelper reference: <f:translate>
FinalYes
ViewHelper to provide a translation for language keys ("locallang"/"LLL").
By default, the files are loaded from the folder Resources/Private/Language/.
Supports two placeholder formats:
-
ICU MessageFormat with named arguments (for labels like "{count, plural, one {# file} other {# files}}"):
<f:translate key="file_count" arguments="{count: fileCount}" /> -
sprintf-style with positional arguments (for labels like "Downloaded %d times from %s"):
<f:translate key="someKey" arguments="{0: 42, 1: 'server'}" />
Example usage:
<f:translate key="LLL:EXT:myext/Resources/Private/Language/locallang.xlf:key1" />
<f:translate key="items_count" arguments="{count: items.count}" />
<f:translate key="someKey" arguments="{0: 'dog', 1: 'fox'}" />
Tags
Table of Contents
Properties
- $escapeChildren : bool
- Output is escaped already. We must not escape children, to avoid double encoding.
Methods
- initializeArguments() : void
- render() : string
- Return array element by key.
Properties
$escapeChildren
Output is escaped already. We must not escape children, to avoid double encoding.
protected
bool
$escapeChildren
= false
Methods
initializeArguments()
public
initializeArguments() : void
render()
Return array element by key.
public
render() : string