.. include:: /Includes.rst.txt .. _typo3-fluid-translate: ==================================== translate ViewHelper `` ==================================== Translate a key from locallang. The files are loaded from the folder :file:`Resources/Private/Language/`. Examples ======== Translate key ------------- :: Value of key ``key1`` in the current website language. Alternatively id can be used instead of key:: This will output the same as above. If both id and key are set, id will take precedence. Keep HTML tags -------------- :: Value of key ``htmlKey`` in the current website language, no :php:`htmlspecialchars()` applied. Translate key from custom locallang file ---------------------------------------- :: or :: Value of key ``key1`` in the current website language. Inline notation with arguments and default value ------------------------------------------------ :: {f:translate(key: 'someKey', arguments: {0: 'dog', 1: 'fox'}, default: 'default value')} Value of key ``someKey`` in the current website language with the given arguments (dog and fox) assigned for the specified ``%s`` conversions (:php:`sprintf()`) in the language file:: Some text about a %s and a %s. The output will be "Some text about a dog and a fox". If the key ``someKey`` is not found in the language file, the output is default value. Inline notation with extension name ----------------------------------- :: {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. .. _typo3-fluid-translate_arguments: Arguments ========= .. _translate_key: key --- :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` Translation Key .. _translate_id: id -- :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` Translation ID. Same as key. .. _translate_default: default ------- :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` 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 .. _translate_arguments: arguments --------- :aspect:`DataType` mixed :aspect:`Required` false :aspect:`Description` Arguments to be replaced in the resulting string .. _translate_extensionname: extensionName ------------- :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` UpperCamelCased extension key (for example BlogExample) .. _translate_languagekey: languageKey ----------- :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` Language key ("da" for example) or "default" to use. Also a Locale object is possible. If empty, use current locale from the request.