#107781[DOCS] Avoid using the constant $GLOBALS['LANG']
Description
At https://docs.typo3.org/permalink/t3coreapi:extension-localization-php we write:
The :php:`\TYPO3\CMS\Core\Localization\LanguageService` could formerly be accessed via the global variable :php:`$GLOBALS[‘LANG’]`. This is now discouraged. Use :php:`LanguageServiceFactory` instead.
So we should not use the discouraged practice in new changelog entries. PPl are prone to copy & paste. And the constant is expecially misleading as it is available while a backend user is logged in so you might not notice right away that it is actually not working in frontend context.
This issue was automatically created from https://github.com/TYPO3/typo3/pull/602
Reviews 1
History 23
-
Gerrit Code Review pushed patch set 1 for main to change 91159 status
NewUnder Review 10/19/25, 05:55 -
Anonymous commented and changed status
Under ReviewResolved done0 %100 % 10/21/25, 15:40 -
Benni Mack changed status
ResolvedClosed 12/02/25, 12:04
Applied in changeset commit:280f4434fa05efe4a21c42cc13d225dcb3f35ed4.