Bug #104774
openContentObjectRenderer initializes the LanguageService incorrectly ignoring set "typo3Language"
0%
Description
The "\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer" does incorrectly initialize the "\TYPO3\CMS\Core\Localization\LanguageService" which leads to ignoring the set `typo3Language`. Yes it is deprecated but there are discussions about reverting it. (see here https://forge.typo3.org/issues/103887)
"\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::getData" does the initialization like so:
$languageService = GeneralUtility::makeInstance(LanguageServiceFactory::class)->createFromSiteLanguage($this->getTypoScriptFrontendController()->getLanguage());
that means it uses
\TYPO3\CMS\Core\Localization\LanguageServiceFactory::createFromSiteLanguage
to init the locale.
This is in contrast to the "\TYPO3\CMS\Extbase\Utility\LocalizationUtility" and the "\TYPO3\CMS\Fluid\ViewHelpers\TranslateViewHelper" which do both use:
\TYPO3\CMS\Core\Localization\Locales::createLocaleFromRequest
to init the locale.
In the end it leads to a mixed usage of locallang files and to a different output for the same language key depending on the context. (extbase or typoscript)
No data to display