Project

General

Profile

Actions

Bug #88517

closed

Localization in Middleware

Added by Roman Büchler over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2019-06-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

Actions #1

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

Actions #2

Updated by Riccardo De Contardi about 5 years ago

  • Category set to Localization
Actions #3

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!

Actions #4

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.

Actions #5

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!

Actions #6

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.

Actions #7

Updated by Riccardo De Contardi about 5 years ago

  • Status changed from Needs Feedback to Closed

Closed in agreement with the reporter.

Actions

Also available in: Atom PDF