See parent task. This is a bug against core, bugs for extensions, if needed, should be subtasks of this one.
|Open||None||T11968 Reduce use of global and public variables|
|Open||None||T159283 Deprecate non-configuration globals|
|Open||None||T160814 Deprecate $wgLang|
|Open||Kizule||T160806 Remove and replace $wgLang in extensions under the social tools umbrella|
One of the more prominent uses in core comes from ContentHandler, seen in most page views when enabling verbose logging:
[wfDebug] [DEBUG] Unstubbing $wgLang on call of $wgLang::unstub from ContentHandler->getPageLanguage
Since T244383: Replace StubUserLang with a better lazy loading mechanism was closed as duplicate, I urge to increase priority of this task. StubUserLang keeps causing severe issues. Search for StubUserLang in Wikimedia-production-error yields about 20 tasks.