Page MenuHomePhabricator

Deprecate $wgLang
Open, MediumPublic

Description

See parent task. This is a bug against core, bugs for extensions, if needed, should be subtasks of this one.

Event Timeline

Krinkle added a subscriber: Krinkle.

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

Change 598143 had a related patch set uploaded (by Krinkle; owner: DannyS712):
[mediawiki/core@master] ParserOptionsTest: Rename non-global variable $wgLang

https://gerrit.wikimedia.org/r/598143

Change 598143 merged by jenkins-bot:
[mediawiki/core@master] ParserOptionsTest: Rename non-global variable $wgLang

https://gerrit.wikimedia.org/r/598143

@DannyS712 I think most if not all uses of $wgLang are basically safe to replace with something like $userLang = RequestContext::getMain()->getLanguage();. Would you be interested in giving this a try in core and/or some of the deployed extension repos?

Codesearch.

@DannyS712 I think most if not all uses of $wgLang are basically safe to replace with something like $userLang = RequestContext::getMain()->getLanguage();. Would you be interested in giving this a try in core and/or some of the deployed extension repos?

Codesearch.

I have a lot on my plate right now, but sure, will look into it. Deliberately *not* claiming this task yet

Change 674845 had a related patch set uploaded (by DannyS712; author: DannyS712):
[mediawiki/core@master] FileDeleteForm: remove use of $wgLang

https://gerrit.wikimedia.org/r/674845

Change 674845 merged by jenkins-bot:
[mediawiki/core@master] FileDeleteForm: Remove use of $wgLang

https://gerrit.wikimedia.org/r/674845

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.

Change 710570 had a related patch set uploaded (by Zabe; author: Zabe):

[mediawiki/core@master] FeedUtils: remove usage of $wgLang

https://gerrit.wikimedia.org/r/710570

Change 710570 merged by jenkins-bot:

[mediawiki/core@master] FeedUtils: remove usage of $wgLang

https://gerrit.wikimedia.org/r/710570