Localized labels
Using XLIFF labels in TypoScript
Extension labels are saved in XLIFF files. TYPO3 can read XLIFF files version 1.2 and 2.0. If a translation of a label on a page is available, TYPO3 outputs the label in the language of the page. TypoScript reads a label from an XLIFF file:
page.20 = TEXT
page.20.data = LLL:EXT:theme_camino/Resources/Private/Language/messages.xlf:menu.label
This looks for the label menu. in the file
Resources/ in the Camino theme,
typo3/theme-camino
.
A page in Spanish needs Spanish to be available in the
site configuration.
TYPO3 then looks for the translation
in the labels path, in
es/. A
language pack installs the file there. If the file has a translation for the label, the
output is "Menú". Otherwise, the output is the default English label "Menu".
Using XLIFF labels in frontend plugins
A plugin outputs every label via an XLIFF file, so that labels can be translated. To prepare labels in an extension for translation, see Localization in TYPO3 Explained.
As an example, the Camino theme uses an XLIFF label to label the menu button. If translations are available, the menu button labels are in Spanish and the Arabic on the Spanish and Arabic pages:
English
The English label
Español
The Spanish label
العربية
The Arabic label
To override a translation with an XLIFF file of your own, see Overriding or extending translations. TypoScript can override a label as well, see _LOCAL_LANG.
If a language does not have translations in TYPO3, you can create the XLIFF files yourself, see Adding custom languages.