Label references / LLL strings 

Strings prefixed with LLL: are found in many places in TYPO3. They are "label references" - references to labels that will be translated into the current language.

The general format of a label reference is:

LLL:EXT:<extension_key>/<path_to_xliff_file>:<identifier>
Copied!

For example:

LLL:EXT:my_extension/Resources/Private/Language/locallang_db.xlf:mytable.myfield
Copied!

If a different language is set or a language file is overridden, the path is automatically adjusted.

File paths in label references 

Localized labels are stored in files with XLIFF format. Most XLIFF files are located in EXT:my_extension/Resources/Private/Language/ and its subfolders.

In some cases the locations are different:

  • Site sets – Localization files for site set definitions are stored in the site set folder, for example: EXT:my_extension/Configuration/Sets/MySet/labels.xlf
  • Content blocks – Third-party extensions can define their own structure. For example, the extension friendsoftypo3/content-blocks stores labels alongside the content block definitions: EXT:my_extension/Configuration/Sets/MySet/labels.xlf

Resolving localized labels 

In many cases, such as the label of a TCA field, you can use a label reference, and TYPO3 will resolve it.

If label references are not resolved, you can do it manually:

Fluid: Using the f:translate ViewHelper 

Use the f:translate ViewHelper to insert translated strings in Fluid templates.

EXT:my_extension/Resources/Private/Templates/SomeTemplate.html
<f:translate key="LLL:EXT:my_extension/Resources/Private/Language/yourFile.xlf:yourKey" />
<!-- or as inline Fluid: -->
{f:translate(key: 'LLL:EXT:my_extension/Resources/Private/Language/yourFile.xlf:yourKey')}
Copied!

See also: The translation ViewHelper f:translate

TypoScript: Using the getText property 

The getText property LLL can be used to fetch translations from a language file and render them in the current language.

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.blogListTitle = TEXT
lib.blogListTitle {
    data = LLL : EXT:blog_example/Resources/Private/Language/locallang.xlf:blog.list
}
Copied!

Make sure to leave spaces around the colon following LLL (as required by general getText syntax).

See also: Output localized strings with TypoScript

PHP: Using the LanguageService 

In PHP localized labels can be retrieved via the LanguageService , which can be created using the LanguageServiceFactory .

The recommended way to determine the correct LanguageService instance depends on context:

  • Frontend: use the language in the current request object ( \ServerRequestInterface ) or the default site language.
  • Backend: use the language of the logged-in backend user.
  • CLI: determine the language programmatically depending on your use case (for example, when sending emails via scheduler tasks).

For more details, see Localization in PHP.

Once you have the correct LanguageService instance, you can resolve labels as follows:

use TYPO3\CMS\Core\Localization\LanguageService;

private function translateSomething(
    LanguageService $languageService,
    string $labelReference
): string {
    return $languageService->sL($labelReference);
}
Copied!