Deprecation: #94414 - LanguageService container entry

See Issue #94414

Description

Instances of TYPO3\CMS\Core\Localization\LanguageService require custom initialization with a language key and additionally depend on Core services. TYPO3\CMS\Core\Localization\LanguageServiceFactory has therefore previously been introduced in order to manage this initialization. This replaced prior used instantiation via TYPO3\CMS\Core\Localization\LanguageService::create() or GeneralUtility::makeInstance(LanguageService::class).

Impact

Injecting TYPO3\CMS\Core\Localization\LanguageService or creating instances via GeneralUtility::makeInstance(LanguageService::class), LanguageService::create(), LanguageService::createFromUserPreferences() or LanguageService::createFromSiteLanguage() will trigger a PHP E_USER_DEPRECATED error.

Affected Installations

Extensions injecting TYPO3\CMS\Core\Localization\LanguageService or creating custom instances via GeneralUtility::makeInstance(LanguageService::class) or TYPO3\CMS\Core\Localization\LanguageService::create().

This is relatively unlikely since most usages are bootstrap related and extensions usually access the prepared LanguageService via GLOBALS['LANG'] in normal cases.

Usages of LanguageService::create(), LanguageService::createFromUserPreferences() and LanguageService::createFromSiteLanguage() are be found by the extension scanner as strong match.

Migration

The factory TYPO3\CMS\Core\Localization\LanguageServiceFactory should be injected and used instead.