Breaking: #107436 - Localization system architecture changes
See forge#107436
Description
The TYPO3 localization system has been migrated to use the Symfony Translation components internally (see Feature: #107436 - Symfony Translation Component integration), which introduces several breaking changes to the internal API and configuration handling.
This change affects only the internal processing of translation ("locallang") files. The public API of the localization system remains unchanged.
Method Signature Changes
The method
\TYPO3\
has a modified signature and behavior:
Before:
public function getParsedData(
$fileReference,
$languageKey,
$_ = null,
$__ = null,
$isLocalizationOverride = false
)
After:
public function getParsedData(string $fileReference, string $languageKey): array
It now only returns the parsed and combined localization data instead of both
the default and the localized data. To obtain the default (English) data, call
get.
Language Key Changes
Internally, the fallback language key has been changed from default to en.
This does not affect public API usage, where default can still represent any
configured language key other than English.
Configuration Changes
Custom parser configuration is no longer supported.
The global configuration option
$GLOBALS has been removed,
and any custom parser registered through it will be ignored.
Several configuration options have been moved or renamed:
$GLOBALS['TYPO3_ CONF_ VARS'] ['SYS'] ['lang'] ['parser'] $GLOBALS→['TYPO3_ CONF_ VARS'] ['SYS'] ['lang'] ['require Approved Localizations'] $GLOBALS['TYPO3_ CONF_ VARS'] ['LANG'] ['require Approved Localizations'] $GLOBALS→['TYPO3_ CONF_ VARS'] ['SYS'] ['lang'] ['format'] $GLOBALS['TYPO3_ CONF_ VARS'] ['LANG'] ['format'] $GLOBALS→['TYPO3_ CONF_ VARS'] ['EXTCONF'] ['lang'] ['available Languages'] $GLOBALS['TYPO3_ CONF_ VARS'] ['LANG'] ['available Locales'] $GLOBALS→['TYPO3_ CONF_ VARS'] ['SYS'] ['locallang XMLOverride'] $GLOBALS['TYPO3_ CONF_ VARS'] ['LANG'] ['resource Overrides']
Impact
Code calling
\TYPO3\
with the old signature or expecting a multi-dimensional array structure will
break:
- The method now enforces strict parameter types.
- The method returns
eninstead ofdefaultfor English translations. - Unused parameters have been removed.
Extensions that register custom localization parsers using
$GLOBALS will no longer have
their parsers executed, potentially leading to missing translations.
Instances using the moved configuration options must update their configuration to the new paths. The old options are no longer recognized and will be ignored.
Affected installations
Installations that:
- Call
Localizationdirectly.Factory:: get Parsed Data () - Register custom localization parsers via the removed configuration option.
- Use any of the renamed or moved configuration options listed above.
Migration
Method Call Updates
Update all calls to
get to use the new signature and ensure
parameter types are correct:
Before:
$data = $factory->getParsedData(
$fileReference,
$languageKey,
null,
null,
false
)[$languageKey];
After:
$data = $factory->getParsedData($fileReference, $languageKey);
Custom Parser Migration
Replace any custom localization parser with a Symfony Translation loader. See Feature: #107436 - Symfony Translation Component integration for detailed migration instructions to the new loader system.