Bug #88517
closedLocalization in Middleware
0%
Description
A Middleware has been configured to be processed after 'typo3/cms-frontend/prepare-tsfe-rendering'.
When fetching a translation in the process method with
$GLOBALS['LANG']->sL('LLL:EXT:myext/Resources/Private/Language/locallang.xlf:item');
the English version is returned even though the default language is German. When using a TYPO3\CMS\Fluid\View\StandaloneView the labels from the template get translated correctly.
Updated by Bastian Bringenberg over 5 years ago
- Project changed from 9 to TYPO3 Core
- Category deleted (
Development) - TYPO3 Version set to 9
- Moved to correct Project
- Guessed Version 9
Updated by Benni Mack about 5 years ago
- Status changed from New to Needs Feedback
Hey,
```
$GLOBALS['LANG']
```
is configured to use the Backend User's language, and only works with the Backend User to be available (= when a BE user is logged in). I suggest you build a custom LanguageService initialization. In addition, the issue 89575 now allows to do this step earlier in TSFE (after TSFE initialization middleware) in v10. Maybe that helps a bit!
Updated by Roman Büchler about 5 years ago
Benni Mack wrote:
Hey,
```
$GLOBALS['LANG']
```is configured to use the Backend User's language, and only works with the Backend User to be available (= when a BE user is logged in). I suggest you build a custom LanguageService initialization. In addition, the issue 89575 now allows to do this step earlier in TSFE (after TSFE initialization middleware) in v10. Maybe that helps a bit!
Thank you very much for the feedback.
Updated by Riccardo De Contardi about 5 years ago
@Roman Büchler thank you for your reply; may I ask you if there is still something that should be done here? Thank you!
Updated by Roman Büchler about 5 years ago
Riccardo De Contardi wrote:
@Roman Büchler thank you for your reply; may I ask you if there is still something that should be done here? Thank you!
No, the ticket could be closed from my side.
Updated by Riccardo De Contardi about 5 years ago
- Status changed from Needs Feedback to Closed
Closed in agreement with the reporter.