Skip to content

Commit 0cfcf6a

Browse files
authored
Merge pull request #36 from b13/bugfix/tsfe-language
[BUGFIX] use language attribute from request
2 parents 8683bf2 + f8dba0c commit 0cfcf6a

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

Classes/Service/ConnectorBase.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -401,13 +401,12 @@ public function getCharsetConverter(): CharsetConverter
401401
protected function initializeLanguageService(): void
402402
{
403403
try {
404-
$applicationType = ApplicationType::fromRequest(
405-
$this->getTypo3Request()
406-
);
404+
$request = $this->getTypo3Request();
405+
$applicationType = ApplicationType::fromRequest($request);
407406
if ($applicationType->isFrontend()) {
408407
$this->languageService = GeneralUtility::makeInstance(LanguageServiceFactory::class)
409408
->createFromSiteLanguage(
410-
$this->getTyposcriptFrontendController()->getLanguage()
409+
$request->getAttribute('language')
411410
);
412411
} else {
413412
$this->languageService = GeneralUtility::makeInstance(LanguageServiceFactory::class)
@@ -435,16 +434,6 @@ protected function getTypo3Request(): ServerRequestInterface
435434
throw new \InvalidArgumentException('Global request object not found');
436435
}
437436

438-
/**
439-
* Wrapper around the global frontend controller object
440-
*
441-
* @return TypoScriptFrontendController
442-
*/
443-
protected function getTyposcriptFrontendController(): TypoScriptFrontendController
444-
{
445-
return $GLOBALS['TSFE'];
446-
}
447-
448437
/**
449438
* Wrapper around the global BE user object
450439
*

0 commit comments

Comments
 (0)