Feature: #82354 - Add possibility to get a label in a specific language¶
See forge#82354
Description¶
The extbase related LocalizationUtility now supports retrieving the localization
of a key in a different language than the initialized language of the given user.
This allows for instance rendering a text in french while the users language is
german. This feature works in the frontend and backend of TYPO3 and supports
to retrieve the labels via an extension name or an explicit specified
LLL:
key.
The ViewHelper <f:
and the utility Localization
do support now two new optional Parameters language
and alternative
to control the output language.
Hint: The alternative
will be used "reversed" (this behaviour was not changed here but could be confusing).
So if the alternative
is defined with "fr,de", then "de" will used before "fr".
Basic Usage¶
\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('someKey', 'extensionName', [], 'da');
<f:translate key="someKey" languageKey="da" />