Index: trunk/extensions/CentralAuth/specials/SpecialCentralAuth.php |
— | — | @@ -104,9 +104,8 @@ |
105 | 105 | if ( !$status->isGood() ) { |
106 | 106 | $this->showStatusError( $status->getWikiText() ); |
107 | 107 | } else { |
108 | | - global $wgLang; |
109 | 108 | $this->showSuccess( 'centralauth-admin-unmerge-success', |
110 | | - $wgLang->formatNum( $status->successCount ), |
| 109 | + $this->getLanguage()->formatNum( $status->successCount ), |
111 | 110 | /* deprecated */ $status->successCount ); |
112 | 111 | } |
113 | 112 | } elseif ( $this->mMethod == 'delete' && $this->mCanUnmerge ) { |
— | — | @@ -257,7 +256,6 @@ |
258 | 257 | * @return String |
259 | 258 | */ |
260 | 259 | function prettyTimespan( $span ) { |
261 | | - global $wgLang; |
262 | 260 | $units = array( |
263 | 261 | 'seconds' => 60, |
264 | 262 | 'minutes' => 60, |
— | — | @@ -270,24 +268,23 @@ |
271 | 269 | // 'centralauth-seconds-ago', 'centralauth-minutes-ago', 'centralauth-hours-ago' |
272 | 270 | // 'centralauth-days-ago', 'centralauth-months-ago', 'centralauth-years-ago' |
273 | 271 | if ( $span < 2 * $chunk ) { |
274 | | - return wfMsgExt( "centralauth-$unit-ago", 'parsemag', $wgLang->formatNum( $span ) ); |
| 272 | + return wfMsgExt( "centralauth-$unit-ago", 'parsemag', $this->getLanguage()->formatNum( $span ) ); |
275 | 273 | } |
276 | 274 | $span = intval( $span / $chunk ); |
277 | 275 | } |
278 | | - return wfMsgExt( "centralauth-$unit-ago", 'parsemag', $wgLang->formatNum( $span ) ); |
| 276 | + return wfMsgExt( "centralauth-$unit-ago", 'parsemag', $this->getLanguage()->formatNum( $span ) ); |
279 | 277 | } |
280 | 278 | |
281 | 279 | function showInfo() { |
282 | 280 | $globalUser = $this->mGlobalUser; |
283 | 281 | |
284 | | - global $wgLang; |
285 | 282 | $reg = $globalUser->getRegistration(); |
286 | 283 | $age = $this->prettyTimespan( wfTimestamp( TS_UNIX ) - wfTimestamp( TS_UNIX, $reg ) ); |
287 | 284 | $attribs = array( |
288 | 285 | 'id' => $globalUser->getId(), |
289 | | - 'registered' => htmlspecialchars( $wgLang->timeanddate( $reg, true ) . " ($age)" ), |
| 286 | + 'registered' => htmlspecialchars( $this->getLanguage()->timeanddate( $reg, true ) . " ($age)" ), |
290 | 287 | 'home' => $this->determineHomeWiki(), |
291 | | - 'editcount' => htmlspecialchars( $wgLang->formatNum( $this->evaluateTotalEditcount() ) ), |
| 288 | + 'editcount' => htmlspecialchars( $this->getLanguage()->formatNum( $this->evaluateTotalEditcount() ) ), |
292 | 289 | 'locked' => wfMsgHtml( $globalUser->isLocked() ? 'centralauth-admin-yes' : 'centralauth-admin-no' ), |
293 | 290 | 'hidden' => $this->formatHiddenLevel( $globalUser->getHiddenLevel() ) |
294 | 291 | ); |
— | — | @@ -392,7 +389,6 @@ |
393 | 390 | * @return string |
394 | 391 | */ |
395 | 392 | function listMergedWikiItem( $row ) { |
396 | | - global $wgLang; |
397 | 393 | if ( $row === null ) { |
398 | 394 | // https://bugzilla.wikimedia.org/show_bug.cgi?id=28767 |
399 | 395 | // It seems sometimes local accounts aren't correctly created |
— | — | @@ -406,7 +402,7 @@ |
407 | 403 | // invisible, to make this column sortable |
408 | 404 | Html::element( 'span', array( 'style' => 'display: none' ), htmlspecialchars( $row['attachedTimestamp'] ) ) . |
409 | 405 | // visible date and time in users preference |
410 | | - htmlspecialchars( $wgLang->timeanddate( $row['attachedTimestamp'], true ) ) . |
| 406 | + htmlspecialchars( $this->getLanguage()->timeanddate( $row['attachedTimestamp'], true ) ) . |
411 | 407 | '</td>' . |
412 | 408 | '<td style="text-align: center">' . $this->formatMergeMethod( $row['attachedMethod'] ) . '</td>' . |
413 | 409 | '<td>' . $this->formatBlockStatus( $row ) . '</td>' . |
— | — | @@ -437,10 +433,9 @@ |
438 | 434 | $reason = $row['block-reason']; |
439 | 435 | return wfMsgExt( 'centralauth-admin-blocked-indef', 'parseinline', array( $reason ) ); |
440 | 436 | } else { |
441 | | - global $wgLang; |
442 | | - $expiry = $wgLang->timeanddate( $row['block-expiry'], true ); |
443 | | - $expiryd = $wgLang->date( $row['block-expiry'], true ); |
444 | | - $expiryt = $wgLang->time( $row['block-expiry'], true ); |
| 437 | + $expiry = $this->getLanguage()->timeanddate( $row['block-expiry'], true ); |
| 438 | + $expiryd = $this->getLanguage()->date( $row['block-expiry'], true ); |
| 439 | + $expiryt = $this->getLanguage()->time( $row['block-expiry'], true ); |
445 | 440 | $reason = $row['block-reason']; |
446 | 441 | |
447 | 442 | $text = wfMsgExt( 'centralauth-admin-blocked', 'parseinline', array( $expiry, $reason, $expiryd, $expiryt ) ); |
— | — | @@ -468,8 +463,7 @@ |
469 | 464 | throw new MWException( "Invalid wiki: {$row['wiki']}" ); |
470 | 465 | } |
471 | 466 | $wikiname = $wiki->getDisplayName(); |
472 | | - global $wgLang; |
473 | | - $editCount = $wgLang->formatNum( intval( $row['editCount'] ) ); |
| 467 | + $editCount = $this->getLanguage()->formatNum( intval( $row['editCount'] ) ); |
474 | 468 | return $this->foreignLink( |
475 | 469 | $row['wiki'], |
476 | 470 | 'Special:Contributions/' . $this->mUserName, |
— | — | @@ -708,10 +702,9 @@ |
709 | 703 | } |
710 | 704 | |
711 | 705 | function addMergeMethodDescriptions() { |
712 | | - global $wgLang; |
713 | 706 | $js = "wgMergeMethodDescriptions = {\n"; |
714 | 707 | foreach ( array( 'primary', 'new', 'empty', 'password', 'mail', 'admin', 'login' ) as $method ) { |
715 | | - $short = Xml::encodeJsVar( $wgLang->ucfirst( wfMsgHtml( "centralauth-merge-method-{$method}" ) ) ); |
| 708 | + $short = Xml::encodeJsVar( $this->getLanguage()->ucfirst( wfMsgHtml( "centralauth-merge-method-{$method}" ) ) ); |
716 | 709 | $desc = Xml::encodeJsVar( wfMsgWikiHtml( "centralauth-merge-method-{$method}-desc" ) ); |
717 | 710 | $js .= "\t'{$method}' : { 'short' : {$short}, 'desc' : {$desc} },\n"; |
718 | 711 | } |
Index: trunk/extensions/CentralAuth/specials/SpecialGlobalUsers.php |
— | — | @@ -109,7 +109,6 @@ |
110 | 110 | * @return string HTML li element with username and info about this user |
111 | 111 | */ |
112 | 112 | function formatRow( $row ) { |
113 | | - global $wgLang; |
114 | 113 | $user = htmlspecialchars( $row->gu_name ); |
115 | 114 | $info = array(); |
116 | 115 | if ( $row->gu_locked ) { |
— | — | @@ -125,7 +124,7 @@ |
126 | 125 | if ( $groups ) { |
127 | 126 | $info[] = $groups; |
128 | 127 | } |
129 | | - $info = $wgLang->commaList( $info ); |
| 128 | + $info = $this->getLanguage()->commaList( $info ); |
130 | 129 | return Html::rawElement( 'li', array(), wfMsgExt( 'centralauth-listusers-item', array('parseinline'), $user, $info ) ); |
131 | 130 | } |
132 | 131 | |