Page MenuHomePhabricator

Remove and replace $wgLang in extensions under the social tools umbrella
Open, Needs TriagePublic

Description

PollNY

PollClass.php:          global $wgLang;
PollClass.php:                          $percent = str_replace( '.0', '', $wgLang->formatNum( $row->pc_vote_count / $poll_vote_count * 100, 1 ) );

SocialProfile

./UserWelcome/includes/UserWelcome.php:		global $wgUser, $wgLang;
./UserWelcome/includes/UserWelcome.php:			$output .= $wgLang->pipeList( $links );
./UserWelcome/includes/UserWelcome.php:							$wgLang->formatNum( $stats_data['points'] )
./UserWelcome/includes/UserWelcome.php:						$wgLang->formatNum( $user_level->getPointsNeededToAdvance() )
./UserActivity/includes/UserActivity.php:		global $wgLang;
./UserActivity/includes/UserActivity.php:			$user_name_short = $wgLang->truncateForVisual( $user->getName(), 25 );
./UserActivity/includes/UserActivity.php:		global $wgLang;
./UserActivity/includes/UserActivity.php:			$user_name_short = htmlspecialchars( $wgLang->truncateForVisual( $user->getName(), 15 ) );
./UserActivity/includes/UserActivity.php:				$comment = $wgLang->truncateForVisual( $msg, 75 );
./UserActivity/includes/UserActivity.php:		global $wgLang;
./UserActivity/includes/UserActivity.php:			$user_name_short = $wgLang->truncateForVisual( $userName, 15 );
./UserActivity/includes/UserActivity.php:		global $wgLang;
./UserActivity/includes/UserActivity.php:				$user_name_short = htmlspecialchars( $wgLang->truncateForVisual( $user_name, 15 ) );
./UserActivity/includes/UserActivity.php:		global $wgLang;
./UserActivity/includes/UserActivity.php:		$preview = $wgLang->truncateForVisual( $comment, 75 );

Video

VideoGallery.php:               global $wgLang;
VideoGallery.php:                               Linker::linkKnown( $nt, htmlspecialchars( $wgLang->truncate( $nt->getText(), 30, '...' ) ) ) . "<br />\n" :
VideoPage.php:          global $wgUser, $wgLang;
VideoPage.php:          $datetime = $wgLang->timeanddate( $timestamp, true );

WikiForum

./includes/WFThread.php:		global $wgRequest, $wgUser, $wgWikiForumAllowAnonymous, $wgWikiForumLogInRC, $wgLang;
./includes/WFThread.php:		$shortText = $wgLang->truncateForDatabase( $text, 50 );
./includes/WFReply.php:		global $wgRequest, $wgUser, $wgWikiForumAllowAnonymous, $wgWikiForumLogInRC, $wgLang;
./includes/WFReply.php:		$shortText = $wgLang->truncateForDatabase( $text, 50 );
./includes/WikiForum.php:		global $wgOut, $wgRequest, $wgUser, $wgLang;
./includes/WikiForumGui.php:		global $wgLang;
./includes/WikiForumGui.php:			$wgLang->timeanddate( $timestamp ),
./includes/WikiForumGui.php:			$wgLang->date( $timestamp ),
./includes/WikiForumGui.php:			$wgLang->time( $timestamp )
./includes/WFForum.php:		global $wgWikiForumLogInRC, $wgUser, $wgRequest, $wgLang;
./includes/WFForum.php:		$shortText = $wgLang->truncateForDatabase( $description, 50 );

Event Timeline

SamanthaNguyen renamed this task from Remove $wgLang in extensions under the social tools umbrella to Remove and replace $wgLang in extensions under the social tools umbrella.Mar 18 2017, 3:53 AM

Change 570319 had a related patch set uploaded (by Jack Phoenix; owner: Jack Phoenix):
[mediawiki/extensions/LinkFilter@master] Get rid of $wgLang

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

Change 570319 merged by jenkins-bot:
[mediawiki/extensions/LinkFilter@master] Get rid of $wgLang

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

Restricted Application added subscribers: RhinosF1, Reception123, Masumrezarock100, jeblad. · View Herald Transcript
Restricted Application added a subscriber: Universal_Omega. · View Herald Transcript

Change 694014 had a related patch set uploaded (by Zoranzoki21; author: Zoranzoki21):

[mediawiki/extensions/PollNY@master] Get rid of $wgLang

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

Change 694017 had a related patch set uploaded (by Zoranzoki21; author: Zoranzoki21):

[mediawiki/extensions/Video@master] Get rid off $wgLang and $wgUser

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

Change 694014 merged by jenkins-bot:

[mediawiki/extensions/PollNY@master] Get rid of $wgLang

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

Change 694017 merged by jenkins-bot:

[mediawiki/extensions/Video@master] Get rid off $wgLang and $wgUser

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

Restricted Application reassigned this task from Kizule to Lens0021. · View Herald TranscriptJan 7 2022, 11:13 PM
Restricted Application reassigned this task from Kizule to Lens0021. · View Herald TranscriptJan 7 2022, 11:16 PM

Sorry for the inconvenience.

Sorry for the inconvenience.

No problem. I guess only WikiForum is left to be done, right?

@ashley Ping. :)

Per a quick codesearch for "wgLang-" across all repos, it seems that WikiForum has 6 remaining uses of $wgLang (3 in includes/WikiForumGui.php, 1 in each of the following files: includes/WFThread.php, includes/WFReply.php and includes/WFForum.php).

In addition to WikiForum, SocialProfile appears to have a bunch of $wgLang uses in UserActivity/includes/UserActivity.php and 3 uses in UserWelcome/includes/UserWelcome.php (and one commented-out line referencing said global in UserProfile/includes/UserProfile.php).

Aklapper subscribed.

@Kizule: Removing task assignee as this open task has been assigned for more than two years - see the email sent to all task assignees on 2024-04-15.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome! :)
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!