Issue Task Closed

#107781[DOCS] Avoid using the constant $GLOBALS['LANG']

TYPO3 GmbH TYPO3com 10/19/25, 05:55 updated 12/02/25, 12:04

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