Internationalization and localization¶
Except for some lowlevel functions, TYPO3 CMS exclusively uses localizable strings for all labels displayed in the backend. This means that the whole user interface may be translated. The encoding is strictly UTF-8.
The default language is English, and the Core ships only with such labels (and so should extensions).
All labels are stored in XLIFF format, generally located in the
Resources/Private/Language folder of an extension (old locations
may still be found in some places). Working with XLIFF files is
described in more detail in Core API.
Adding a language to TYPO3 CMS¶
The list of supported languages is defined in
\TYPO3\CMS\Core\Localization\Locales::$languages. Adding support for a
new language thus starts by adding the language there and waiting for the next
Translating TYPO3 CMS¶
The ADMIN TOOL > Languages module shows a list of available languages. In the "Installed Languages" view, you can choose which languages you would like to make available to your users.
By using the "Download all" icon in the docheader the update of translations
for all extensions in all selected languages is triggered. The downloaded
language packs are stored in
The "Translation Overview" view of the Languages module offers a fine-grained interface, where a single language pack can be downloaded.
All languages packs can also be fetched using the command line:
/path/to/typo3/bin/typo3 extbase language:update
The language classes¶
Various classes are involved in the localization process.
\TYPO3\CMS\Core\Localization\LocalizationFactory class is dedicated
to loading the language files. It also manages
\TYPO3\CMS\Core\Localization\LanguageService provides the actual
methods to retrieve a localized label.
getLL() gets a label from an
already loaded language file.
sL() loads a language file first and then
returns a label from it (using a string with the
LLL:EXT:... syntax as
\TYPO3\CMS\Extbase\Utility\LocalizationUtility is essentially a
convenience wrapper around the
\TYPO3\CMS\Core\Localization\LanguageService class, whose
translate() method also takes an array as argument and runs PHP's
vsprintf() on the localized string.