Language
Contains Language resources.
See also
- Read more about localizing extensions: Localization
- Read more about the XLIFF format in the following chapter: XLIFF Format.
- Read more about applying localised labels in the following chapter: Working with XLIFF files.
In the folder EXT:
language
files are stored in format .xlf
.
This folder contains all language labels supplied by the extension in the default language English.
If the extension should provide additional translations into
custom languages, they can be stored in language files of the same name with a
language prefix. The German translation of the file locallang.
must be stored in the same folder in a file called de.
,
the French translation in fr.
. If the translations are
stored in a different file name they will not be found.
Any arbitrary file name with ending .xlf
can be used.
The following file names are commonly used:
locallang.xlf
This file commonly contains translated labels to be used in the frontend.
In the templates of Extbase plugins all labels in the file
EXT:
can
be accessed without using the complete path:
<f:translate key="key1" extensionName="MyExtension"/>
From other template contexts the labels can be used by using the complete
LLL:
path:
<f:translate key="LLL:EXT:my_extension/Resources/Private/Language/locallang.xlf:key1" />
The documentation for the ViewHelper can be found at Translate ViewHelper <f:translate>.
Language labels to be used in PHP, TypoScript etc must also be prefixed with the complete path.
locallang_db.xlf
By convention, the file
EXT:
should contain
all localized labels used for the TCA labels, descriptions etc.
These labels need to be always accessed by their complete path in the TCA configuration:
return [
'ctrl' => [
'title' => 'LLL:EXT:examples/Resources/Private/Language/locallang_db.xlf:tx_examples_dummy',
// ...
],
// ...
];