Package

ViewHelpers

ViewHelper Documentation

translate

Translate a key from locallang. The files are loaded from the folder "Resources/Private/Language/".

== Examples ==

<f:translate key="key1" /> value of key "key1" in the current website language

<f:format.raw><f:translate key="htmlKey" /></f:format.raw> value of key "htmlKey" in the current website language, no htmlspecialchars applied

<f:translate key="LLL:EXT:myext/Resources/Private/Language/locallang.xlf:key1" /> value of key "key1" in the current website language

{f:translate(key: 'argumentsKey', arguments: {0: 'dog', 1: 'fox'}, default: 'default value')} value of key "argumentsKey" in the current website language with "%1" and "%2" are replaced by "dog" and "fox" (printf) if the key is not found, the output is "default value"

{f:translate(key: 'someKey', extensionName: 'SomeExtensionName')} value of key "someKey" in the current website language the locallang file of extension "some_extension_name" will be used

<f:translate id="key1" /> value of id "key1" in the current website language

Arguments

key string, required

Translation Key

id string, required

Translation Key compatible to TYPO3 Flow

default string, required

If the given locallang key could not be found, this value is used. If this argument is not set, child nodes will be used to render the default

arguments anySimpleType, required

Arguments to be replaced in the resulting string

extensionName string, required

UpperCamelCased extension key (for example BlogExample)

languageKey string, required

Language key ("dk" for example) or "default" to use for this translation. If this argument is empty, we use the current language

alternativeLanguageKeys anySimpleType, required

Alternative language keys if no translation does exist

ViewHelper Resources

Schema Resources