From 216d661d3b0098b93926b485fb986e66d9cb0bad Mon Sep 17 00:00:00 2001 From: John Du Hart Date: Mon, 21 Nov 2011 16:13:21 +0000 Subject: [PATCH] Bug 29524 - Rename RequestContext::getLang to getLanguage I'll be amazed if this doens't break any tests. --- includes/Action.php | 77 +------------------ includes/Article.php | 4 +- includes/CategoryViewer.php | 2 +- includes/ChangesList.php | 28 +++---- includes/Message.php | 2 +- includes/OutputPage.php | 16 ++-- includes/Pager.php | 12 +-- includes/Preferences.php | 14 ++-- includes/QueryPage.php | 6 +- includes/RevisionList.php | 36 ++------- includes/Skin.php | 8 +- includes/SkinTemplate.php | 8 +- includes/SpecialPage.php | 77 +------------------ includes/SpecialPageFactory.php | 2 +- includes/StubObject.php | 2 +- includes/actions/CreditsAction.php | 4 +- includes/actions/HistoryAction.php | 4 +- includes/actions/InfoAction.php | 18 ++--- includes/actions/RevertAction.php | 6 +- includes/cache/HTMLFileCache.php | 2 +- includes/context/ContextSource.php | 12 ++- includes/context/DerivativeContext.php | 12 ++- includes/context/IContextSource.php | 8 ++ includes/context/RequestContext.php | 10 ++- includes/diff/DifferenceEngine.php | 2 +- includes/logging/LogFormatter.php | 8 +- includes/parser/ParserOptions.php | 2 +- includes/revisiondelete/RevisionDelete.php | 18 ++--- includes/specials/SpecialActiveusers.php | 4 +- includes/specials/SpecialAllmessages.php | 8 +- includes/specials/SpecialAllpages.php | 6 +- includes/specials/SpecialAncientpages.php | 4 +- includes/specials/SpecialBlock.php | 2 +- includes/specials/SpecialBlockList.php | 8 +- includes/specials/SpecialBrokenRedirects.php | 4 +- includes/specials/SpecialCategories.php | 2 +- includes/specials/SpecialChangePassword.php | 2 +- includes/specials/SpecialConfirmemail.php | 6 +- includes/specials/SpecialContributions.php | 6 +- .../specials/SpecialDeletedContributions.php | 8 +- includes/specials/SpecialDisambiguations.php | 2 +- includes/specials/SpecialDoubleRedirects.php | 2 +- includes/specials/SpecialEditWatchlist.php | 14 ++-- includes/specials/SpecialFewestrevisions.php | 2 +- .../specials/SpecialFileDuplicateSearch.php | 10 +-- includes/specials/SpecialImport.php | 4 +- includes/specials/SpecialLinkSearch.php | 2 +- includes/specials/SpecialListfiles.php | 4 +- includes/specials/SpecialListgrouprights.php | 2 +- includes/specials/SpecialListredirects.php | 2 +- includes/specials/SpecialListusers.php | 2 +- includes/specials/SpecialMIMEsearch.php | 2 +- includes/specials/SpecialMergeHistory.php | 2 +- includes/specials/SpecialMostcategories.php | 2 +- includes/specials/SpecialMostlinked.php | 2 +- .../specials/SpecialMostlinkedcategories.php | 2 +- .../specials/SpecialMostlinkedtemplates.php | 2 +- includes/specials/SpecialMovepage.php | 8 +- includes/specials/SpecialNewimages.php | 2 +- includes/specials/SpecialNewpages.php | 6 +- includes/specials/SpecialPopularpages.php | 2 +- includes/specials/SpecialProtectedpages.php | 2 +- includes/specials/SpecialProtectedtitles.php | 2 +- includes/specials/SpecialRecentchanges.php | 20 ++--- includes/specials/SpecialRevisiondelete.php | 8 +- includes/specials/SpecialSearch.php | 6 +- includes/specials/SpecialShortpages.php | 2 +- includes/specials/SpecialStatistics.php | 26 +++---- includes/specials/SpecialTags.php | 2 +- includes/specials/SpecialUndelete.php | 38 ++++----- includes/specials/SpecialUnusedtemplates.php | 2 +- includes/specials/SpecialUnwatchedpages.php | 2 +- includes/specials/SpecialUpload.php | 14 ++-- includes/specials/SpecialUserlogin.php | 2 +- includes/specials/SpecialUserrights.php | 4 +- includes/specials/SpecialVersion.php | 4 +- includes/specials/SpecialWantedcategories.php | 2 +- includes/specials/SpecialWatchlist.php | 10 +-- includes/specials/SpecialWhatlinkshere.php | 6 +- skins/CologneBlue.php | 4 +- skins/Standard.php | 4 +- tests/parser/parserTest.inc | 4 +- .../phpunit/includes/parser/NewParserTest.php | 4 +- .../phpunit/suites/UploadFromUrlTestSuite.php | 2 +- 84 files changed, 284 insertions(+), 422 deletions(-) diff --git a/includes/Action.php b/includes/Action.php index 22879410a5..fd4a0a6e23 100644 --- a/includes/Action.php +++ b/includes/Action.php @@ -23,7 +23,7 @@ * * @file */ -abstract class Action { +abstract class Action extends ContextSource { /** * Page on which we're performing the action @@ -95,81 +95,6 @@ abstract class Action { return self::getClass( $name, array() ) !== null; } - /** - * Get the IContextSource in use here - * @return IContextSource - */ - public final function getContext() { - if ( $this->context instanceof IContextSource ) { - return $this->context; - } - return $this->page->getContext(); - } - - /** - * Get the WebRequest being used for this instance - * - * @return WebRequest - */ - public final function getRequest() { - return $this->getContext()->getRequest(); - } - - /** - * Get the OutputPage being used for this instance - * - * @return OutputPage - */ - public final function getOutput() { - return $this->getContext()->getOutput(); - } - - /** - * Shortcut to get the User being used for this instance - * - * @return User - */ - public final function getUser() { - return $this->getContext()->getUser(); - } - - /** - * Shortcut to get the Skin being used for this instance - * - * @return Skin - */ - public final function getSkin() { - return $this->getContext()->getSkin(); - } - - /** - * Shortcut to get the user Language being used for this instance - * - * @return Skin - */ - public final function getLang() { - return $this->getContext()->getLang(); - } - - /** - * Shortcut to get the Title object from the page - * @return Title - */ - public final function getTitle() { - return $this->page->getTitle(); - } - - /** - * Get a Message object with context set - * Parameters are the same as wfMessage() - * - * @return Message object - */ - public final function msg() { - $params = func_get_args(); - return call_user_func_array( array( $this->getContext(), 'msg' ), $params ); - } - /** * Protected constructor: use Action::factory( $action, $page ) to actually build * these things in the real world diff --git a/includes/Article.php b/includes/Article.php index 6901165600..92e6f06fbd 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -666,8 +666,8 @@ class Article extends Page { protected function showCssOrJsPage() { global $wgOut; - $dir = $this->getContext()->getLang()->getDir(); - $lang = $this->getContext()->getLang()->getCode(); + $dir = $this->getContext()->getLanguage()->getDir(); + $lang = $this->getContext()->getLanguage()->getCode(); $wgOut->wrapWikiMsg( "
\n$1\n
", 'clearyourcache' ); diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index c64bb7389d..cfebdd1f1e 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -108,7 +108,7 @@ class CategoryViewer extends ContextSource { $r = wfMsgExt( 'category-empty', array( 'parse' ) ); } - $lang = $this->getLang(); + $lang = $this->getLanguage(); $langAttribs = array( 'lang' => $lang->getCode(), 'dir' => $lang->getDir() ); # put a div around the headings which are in the user language $r = Html::openElement( 'div', $langAttribs ) . $r . ''; diff --git a/includes/ChangesList.php b/includes/ChangesList.php index d8eab4350a..d603c1657f 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -235,7 +235,7 @@ class ChangesList extends ContextSource { public function insertDateHeader( &$s, $rc_timestamp ) { # Make date header if necessary - $date = $this->getLang()->date( $rc_timestamp, true, true ); + $date = $this->getLanguage()->date( $rc_timestamp, true, true ); if( $date != $this->lastdate ) { if( $this->lastdate != '' ) { $s .= "\n"; @@ -326,7 +326,7 @@ class ChangesList extends ContextSource { $articlelink = "{$articlelink}"; } # RTL/LTR marker - $articlelink .= $this->getLang()->getDirMark(); + $articlelink .= $this->getLanguage()->getDirMark(); wfRunHooks( 'ChangesListInsertArticleLink', array(&$this, &$articlelink, &$s, &$rc, $unpatrolled, $watched) ); @@ -341,7 +341,7 @@ class ChangesList extends ContextSource { */ public function insertTimestamp( &$s, $rc ) { $s .= $this->message['semicolon-separator'] . - $this->getLang()->time( $rc->mAttribs['rc_timestamp'], true, true ) . ' . . '; + $this->getLanguage()->time( $rc->mAttribs['rc_timestamp'], true, true ) . ' . . '; } /** Insert links to user page, user talk page and eventually a blocking link @@ -352,7 +352,7 @@ class ChangesList extends ContextSource { if( $this->isDeleted( $rc, Revision::DELETED_USER ) ) { $s .= ' ' . wfMsgHtml( 'rev-deleted-user' ) . ''; } else { - $s .= $this->getLang()->getDirMark() . Linker::userLink( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); + $s .= $this->getLanguage()->getDirMark() . Linker::userLink( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); $s .= Linker::userToolLinks( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); } } @@ -364,7 +364,7 @@ class ChangesList extends ContextSource { public function insertLogEntry( $rc ) { $formatter = LogFormatter::newFromRow( $rc->mAttribs ); $formatter->setShowUserToolLinks( true ); - $mark = $this->getLang()->getDirMark(); + $mark = $this->getLanguage()->getDirMark(); return $formatter->getActionText() . " $mark" . $formatter->getComment(); } @@ -399,7 +399,7 @@ class ChangesList extends ContextSource { if( $count > 0 ) { if( !isset( $cache[$count] ) ) { $cache[$count] = wfMsgExt( 'number_of_watching_users_RCview', - array('parsemag', 'escape' ), $this->getLang()->formatNum( $count ) ); + array('parsemag', 'escape' ), $this->getLanguage()->formatNum( $count ) ); } return $cache[$count]; } else { @@ -572,7 +572,7 @@ class OldChangesList extends ChangesList { # User tool links $this->insertUserRelatedLinks( $s, $rc ); # LTR/RTL direction mark - $s .= $this->getLang()->getDirMark(); + $s .= $this->getLanguage()->getDirMark(); $s .= $this->insertComment( $rc ); } @@ -586,7 +586,7 @@ class OldChangesList extends ChangesList { # How many users watch this page if( $rc->numberofWatchingusers > 0 ) { $s .= ' ' . wfMsgExt( 'number_of_watching_users_RCview', - array( 'parsemag', 'escape' ), $this->getLang()->formatNum( $rc->numberofWatchingusers ) ); + array( 'parsemag', 'escape' ), $this->getLanguage()->formatNum( $rc->numberofWatchingusers ) ); } if( $this->watchlist ) { @@ -635,7 +635,7 @@ class EnhancedChangesList extends ChangesList { $curIdEq = array( 'curid' => $rc->mAttribs['rc_cur_id'] ); # If it's a new day, add the headline and flush the cache - $date = $this->getLang()->date( $rc->mAttribs['rc_timestamp'], true ); + $date = $this->getLanguage()->date( $rc->mAttribs['rc_timestamp'], true ); $ret = ''; if( $date != $this->lastdate ) { # Process current cache @@ -689,7 +689,7 @@ class EnhancedChangesList extends ChangesList { $showdifflinks = false; } - $time = $this->getLang()->time( $rc->mAttribs['rc_timestamp'], true, true ); + $time = $this->getLanguage()->time( $rc->mAttribs['rc_timestamp'], true, true ); $rc->watched = $watched; $rc->link = $clink; $rc->timestamp = $time; @@ -838,9 +838,9 @@ class EnhancedChangesList extends ChangesList { $users = array(); foreach( $userlinks as $userlink => $count) { $text = $userlink; - $text .= $this->getLang()->getDirMark(); + $text .= $this->getLanguage()->getDirMark(); if( $count > 1 ) { - $text .= ' (' . $this->getLang()->formatNum( $count ) . '×)'; + $text .= ' (' . $this->getLanguage()->formatNum( $count ) . '×)'; } array_push( $users, $text ); } @@ -880,14 +880,14 @@ class EnhancedChangesList extends ChangesList { $this->insertArticleLink( $r, $block[0], $block[0]->unpatrolled, $block[0]->watched ); } - $r .= $this->getLang()->getDirMark(); + $r .= $this->getLanguage()->getDirMark(); $queryParams['curid'] = $curId; # Changes message $n = count($block); static $nchanges = array(); if ( !isset( $nchanges[$n] ) ) { - $nchanges[$n] = wfMsgExt( 'nchanges', array( 'parsemag', 'escape' ), $this->getLang()->formatNum( $n ) ); + $nchanges[$n] = wfMsgExt( 'nchanges', array( 'parsemag', 'escape' ), $this->getLanguage()->formatNum( $n ) ); } # Total change link $r .= ' '; diff --git a/includes/Message.php b/includes/Message.php index 578e5f10e0..e253b4a1a8 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -211,7 +211,7 @@ class Message { * @return Message: $this */ public function setContext( IContextSource $context ) { - $this->inLanguage( $context->getLang() ); + $this->inLanguage( $context->getLanguage() ); $this->title( $context->getTitle() ); return $this; diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 93fd649c38..398cddedac 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2244,7 +2244,7 @@ $templates ? 'lag-warn-normal' : 'lag-warn-high'; $wrap = Html::rawElement( 'div', array( 'class' => "mw-{$message}" ), "\n$1\n" ); - $this->wrapWikiMsg( "$wrap\n", array( $message, $this->getLang()->formatNum( $lag ) ) ); + $this->wrapWikiMsg( "$wrap\n", array( $message, $this->getLanguage()->formatNum( $lag ) ) ); } } @@ -2328,14 +2328,14 @@ $templates */ public function headElement( Skin $sk, $includeStyle = true ) { global $wgContLang, $wgUseTrackbacks; - $userdir = $this->getLang()->getDir(); + $userdir = $this->getLanguage()->getDir(); $sitedir = $wgContLang->getDir(); if ( $sk->commonPrintStylesheet() ) { $this->addModuleStyles( 'mediawiki.legacy.wikiprintable' ); } - $ret = Html::htmlHeader( array( 'lang' => $this->getLang()->getCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) ); + $ret = Html::htmlHeader( array( 'lang' => $this->getLanguage()->getCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) ); if ( $this->getHTMLTitle() == '' ) { $this->setHTMLTitle( $this->msg( 'pagetitle', $this->getPageTitle() ) ); @@ -2370,7 +2370,7 @@ $templates # Classes for LTR/RTL directionality support $bodyAttrs['class'] = "mediawiki $userdir sitedir-$sitedir"; - if ( $this->getLang()->capitalizeAllNouns() ) { + if ( $this->getLanguage()->capitalizeAllNouns() ) { # A class is probably not the best way to do this . . . $bodyAttrs['class'] .= ' capitalize-all-nouns'; } @@ -2504,7 +2504,7 @@ $templates // correct timestamp and emptiness data $query = ResourceLoader::makeLoaderQuery( array(), // modules; not determined yet - $this->getLang()->getCode(), + $this->getLanguage()->getCode(), $this->getSkin()->getSkinName(), $user, null, // version; not determined yet @@ -2560,7 +2560,7 @@ $templates $url = ResourceLoader::makeLoaderURL( array_keys( $modules ), - $this->getLang()->getCode(), + $this->getLanguage()->getCode(), $this->getSkin()->getSkinName(), $user, $version, @@ -3070,7 +3070,7 @@ $templates * @param $flip String: Set to 'flip' to flip the CSS if needed */ public function addInlineStyle( $style_css, $flip = 'noflip' ) { - if( $flip === 'flip' && $this->getLang()->isRTL() ) { + if( $flip === 'flip' && $this->getLanguage()->isRTL() ) { # If wanted, and the interface is right-to-left, flip the CSS $style_css = CSSJanus::transform( $style_css, true, false ); } @@ -3189,7 +3189,7 @@ $templates */ protected function styleLink( $style, $options ) { if( isset( $options['dir'] ) ) { - if( $this->getLang()->getDir() != $options['dir'] ) { + if( $this->getLanguage()->getDir() != $options['dir'] ) { return ''; } } diff --git a/includes/Pager.php b/includes/Pager.php index 57eb926a0a..a03a1d1d4c 100644 --- a/includes/Pager.php +++ b/includes/Pager.php @@ -551,7 +551,7 @@ abstract class IndexPager extends ContextSource implements Pager { } foreach ( $this->mLimitsShown as $limit ) { $links[] = $this->makeLink( - $this->getLang()->formatNum( $limit ), + $this->getLanguage()->formatNum( $limit ), array( 'offset' => $offset, 'limit' => $limit ), 'num' ); @@ -657,7 +657,7 @@ abstract class AlphabeticPager extends IndexPager { return $this->mNavigationBar; } - $lang = $this->getLang(); + $lang = $this->getLanguage(); $opts = array( 'parsemag', 'escapenoentities' ); $linkTexts = array( @@ -750,7 +750,7 @@ abstract class ReverseChronologicalPager extends IndexPager { return $this->mNavigationBar; } - $nicenumber = $this->getLang()->formatNum( $this->mLimit ); + $nicenumber = $this->getLanguage()->formatNum( $this->mLimit ); $linkTexts = array( 'prev' => wfMsgExt( 'pager-newer-n', @@ -768,7 +768,7 @@ abstract class ReverseChronologicalPager extends IndexPager { $pagingLinks = $this->getPagingLinks( $linkTexts ); $limitLinks = $this->getLimitLinks(); - $limits = $this->getLang()->pipeList( $limitLinks ); + $limits = $this->getLanguage()->pipeList( $limitLinks ); $this->mNavigationBar = "({$pagingLinks['first']}" . wfMsgExt( 'pipe-separator' , 'escapenoentities' ) . @@ -1016,7 +1016,7 @@ abstract class TablePager extends IndexPager { 'next' => 'arrow_disabled_right_25.png', 'last' => 'arrow_disabled_last_25.png', ); - if( $this->getLang()->isRTL() ) { + if( $this->getLanguage()->isRTL() ) { $keys = array_keys( $labels ); $images = array_combine( $keys, array_reverse( $images ) ); $disabledImages = array_combine( $keys, array_reverse( $disabledImages ) ); @@ -1060,7 +1060,7 @@ abstract class TablePager extends IndexPager { # will be a string. if( is_int( $value ) ){ $limit = $value; - $text = $this->getLang()->formatNum( $limit ); + $text = $this->getLanguage()->formatNum( $limit ); } else { $limit = $key; $text = $value; diff --git a/includes/Preferences.php b/includes/Preferences.php index b82d662f35..7126b2bf59 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -171,7 +171,7 @@ class Preferences { asort( $userGroups ); asort( $userMembers ); - $lang = $context->getLang(); + $lang = $context->getLanguage(); $defaultPreferences['usergroups'] = array( 'type' => 'info', @@ -485,7 +485,7 @@ class Preferences { $defaultPreferences['commoncssjs'] = array( 'type' => 'info', 'raw' => true, - 'default' => $context->getLang()->pipeList( $linkTools ), + 'default' => $context->getLanguage()->pipeList( $linkTools ), 'label-message' => 'prefs-common-css-js', 'section' => 'rendering/skin', ); @@ -493,7 +493,7 @@ class Preferences { $selectedSkin = $user->getOption( 'skin' ); if ( in_array( $selectedSkin, array( 'cologneblue', 'standard' ) ) ) { - $settings = array_flip( $context->getLang()->getQuickbarSettings() ); + $settings = array_flip( $context->getLanguage()->getQuickbarSettings() ); $defaultPreferences['quickbar'] = array( 'type' => 'radio', @@ -545,7 +545,7 @@ class Preferences { // Info $now = wfTimestampNow(); - $lang = $context->getLang(); + $lang = $context->getLanguage(); $nowlocal = Xml::element( 'span', array( 'id' => 'wpLocalTime' ), $lang->time( $now, true ) ); $nowserver = $lang->time( $now, false ) . @@ -1082,7 +1082,7 @@ class Preferences { $linkTools[] = Linker::link( $jsPage, $context->msg( 'prefs-custom-js' )->escaped() ); } - $display = $sn . ' ' . $context->msg( 'parentheses', $context->getLang()->pipeList( $linkTools ) )->text(); + $display = $sn . ' ' . $context->msg( 'parentheses', $context->getLanguage()->pipeList( $linkTools ) )->text(); $ret[$display] = $skinkey; } @@ -1094,7 +1094,7 @@ class Preferences { * @return array */ static function getDateOptions( IContextSource $context ) { - $dateopts = $context->getLang()->getDatePreferences(); + $dateopts = $context->getLanguage()->getDatePreferences(); $ret = array(); @@ -1115,7 +1115,7 @@ class Preferences { if ( $key == 'default' ) { $formatted = $context->msg( 'datedefault' )->escaped(); } else { - $formatted = htmlspecialchars( $context->getLang()->timeanddate( $epoch, false, $key ) ); + $formatted = htmlspecialchars( $context->getLanguage()->timeanddate( $epoch, false, $key ) ); } $ret[$formatted] = $key; } diff --git a/includes/QueryPage.php b/includes/QueryPage.php index eac869adaa..ef675c0e53 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -470,7 +470,7 @@ abstract class QueryPage extends SpecialPage { $ts = $this->getCachedTimestamp(); if ( $ts ) { - $lang = $this->getLang(); + $lang = $this->getLanguage(); $updated = $lang->timeanddate( $ts, true, true ); $updateddate = $lang->date( $ts, true, true ); $updatedtime = $lang->time( $ts, true, true ); @@ -505,7 +505,7 @@ abstract class QueryPage extends SpecialPage { $out->addHTML( $this->msg( 'showingresults' )->numParams( $this->numRows, $this->offset + 1 )->parseAsBlock() ); # Disable the "next" link when we reach the end - $paging = $this->getLang()->viewPrevNext( $this->getTitle( $par ), $this->offset, + $paging = $this->getLanguage()->viewPrevNext( $this->getTitle( $par ), $this->offset, $this->limit, $this->linkParameters(), ( $this->numRows < $this->limit ) ); $out->addHTML( '

' . $paging . '

' ); } else { @@ -777,7 +777,7 @@ abstract class WantedQueryPage extends QueryPage { array( 'broken' ) ); } - return $this->getLang()->specialList( $pageLink, $this->makeWlhLink( $title, $result ) ); + return $this->getLanguage()->specialList( $pageLink, $this->makeWlhLink( $title, $result ) ); } else { return $this->msg( 'wantedpages-badtitle', $result->title )->escaped(); } diff --git a/includes/RevisionList.php b/includes/RevisionList.php index 5a9bbad01a..814e2dfa80 100644 --- a/includes/RevisionList.php +++ b/includes/RevisionList.php @@ -2,15 +2,11 @@ /** * List for revision table items for a single page */ -abstract class RevisionListBase { +abstract class RevisionListBase extends ContextSource { /** * @var Title */ var $title; - /** - * @var IContextSource - */ - var $context; var $ids, $res, $current; @@ -20,7 +16,7 @@ abstract class RevisionListBase { * @param $title Title */ function __construct( IContextSource $context, Title $title ) { - $this->context = $context; + $this->setContext( $context ); $this->title = $title; } @@ -104,24 +100,6 @@ abstract class RevisionListBase { * @param $row stdclass */ abstract public function newItem( $row ); - - /** - * Get the language of the user doing the action - * - * @return Language object - */ - public function getLang() { - return $this->context->getLang(); - } - - /** - * Get the user doing the action - * - * @return User object - */ - public function getUser() { - return $this->context->getUser(); - } } /** @@ -187,16 +165,16 @@ abstract class RevisionItemBase { * Get the date, formatted in user's languae */ public function formatDate() { - return $this->list->context->getLang()->userDate( $this->getTimestamp(), - $this->list->context->getUser() ); + return $this->list->getLanguage()->userDate( $this->getTimestamp(), + $this->list->getUser() ); } /** * Get the time, formatted in user's languae */ public function formatTime() { - return $this->list->context->getLang()->userTime( $this->getTimestamp(), - $this->list->context->getUser() ); + return $this->list->getLanguage()->userTime( $this->getTimestamp(), + $this->list->getUser() ); } /** @@ -316,7 +294,7 @@ class RevisionItem extends RevisionItemBase { * Overridden by RevDel_ArchiveItem. */ protected function getRevisionLink() { - $date = $this->list->getLang()->timeanddate( $this->revision->getTimestamp(), true ); + $date = $this->list->getLanguage()->timeanddate( $this->revision->getTimestamp(), true ); if ( $this->isDeleted() && !$this->canViewContent() ) { return $date; } diff --git a/includes/Skin.php b/includes/Skin.php index 26de63cd8c..dc697a363a 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -739,7 +739,7 @@ abstract class Skin extends ContextSource { $msgObj = $this->msg( $msg )->rawParams( $link ); if ( $forContent ) { $msg = $msgObj->inContentLanguage()->text(); - if ( $this->getLang()->getCode() !== $wgContLang->getCode() ) { + if ( $this->getLanguage()->getCode() !== $wgContLang->getCode() ) { $msg = Html::rawElement( 'span', array( 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ), $msg ); } return $msg; @@ -801,8 +801,8 @@ abstract class Skin extends ContextSource { } if ( $timestamp ) { - $d = $this->getLang()->userDate( $timestamp, $this->getUser() ); - $t = $this->getLang()->userTime( $timestamp, $this->getUser() ); + $d = $this->getLanguage()->userDate( $timestamp, $this->getUser() ); + $t = $this->getLanguage()->userTime( $timestamp, $this->getUser() ); $s = ' ' . $this->msg( 'lastmodifiedat', $d, $t )->text(); } else { $s = ''; @@ -1061,7 +1061,7 @@ abstract class Skin extends ContextSource { global $parserMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry; wfProfileIn( __METHOD__ ); - $key = wfMemcKey( 'sidebar', $this->getLang()->getCode() ); + $key = wfMemcKey( 'sidebar', $this->getLanguage()->getCode() ); if ( $wgEnableSidebarCache ) { $cachedsidebar = $parserMemc->get( $key ); diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 807921b727..2ab01bc0b7 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -296,14 +296,14 @@ class SkinTemplate extends Skin { $contentlang = $wgContLang->getCode(); $contentdir = $wgContLang->getDir(); - $userlang = $this->getLang()->getCode(); - $userdir = $this->getLang()->getDir(); + $userlang = $this->getLanguage()->getCode(); + $userdir = $this->getLanguage()->getDir(); $tpl->set( 'lang', $userlang ); $tpl->set( 'dir', $userdir ); - $tpl->set( 'rtl', $this->getLang()->isRTL() ); + $tpl->set( 'rtl', $this->getLanguage()->isRTL() ); - $tpl->set( 'capitalizeallnouns', $this->getLang()->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' ); + $tpl->set( 'capitalizeallnouns', $this->getLanguage()->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' ); $tpl->set( 'showjumplinks', $user->getOption( 'showjumplinks' ) ); $tpl->set( 'username', $user->isAnon() ? null : $this->username ); $tpl->set( 'userdisplayname', $user->isAnon() ? null : $this->userdisplayname ); diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 60ed5dde84..64c42878ab 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -27,7 +27,7 @@ * page list. * @ingroup SpecialPage */ -class SpecialPage { +class SpecialPage extends ContextSource { // The canonical name of this special page // Also used for the default

heading, @see getDescription() @@ -611,81 +611,6 @@ class SpecialPage { return self::getTitleFor( $this->mName, $subpage ); } - /** - * Sets the context this SpecialPage is executed in - * - * @param $context IContextSource - * @since 1.18 - */ - public function setContext( $context ) { - $this->mContext = $context; - } - - /** - * Gets the context this SpecialPage is executed in - * - * @return IContextSource - * @since 1.18 - */ - public function getContext() { - if ( $this->mContext instanceof IContextSource ) { - return $this->mContext; - } else { - wfDebug( __METHOD__ . " called and \$mContext is null. Return RequestContext::getMain(); for sanity\n" ); - return RequestContext::getMain(); - } - } - - /** - * Get the WebRequest being used for this instance - * - * @return WebRequest - * @since 1.18 - */ - public function getRequest() { - return $this->getContext()->getRequest(); - } - - /** - * Get the OutputPage being used for this instance - * - * @return OutputPage - * @since 1.18 - */ - public function getOutput() { - return $this->getContext()->getOutput(); - } - - /** - * Shortcut to get the User executing this instance - * - * @return User - * @since 1.18 - */ - public function getUser() { - return $this->getContext()->getUser(); - } - - /** - * Shortcut to get the skin being used for this instance - * - * @return Skin - * @since 1.18 - */ - public function getSkin() { - return $this->getContext()->getSkin(); - } - - /** - * Shortcut to get user's language - * - * @return Language - * @since 1.18 - */ - public function getLang() { - return $this->getContext()->getLang(); - } - /** * Return the full title, including $par * diff --git a/includes/SpecialPageFactory.php b/includes/SpecialPageFactory.php index 27cdc3eb35..b6aa42308a 100644 --- a/includes/SpecialPageFactory.php +++ b/includes/SpecialPageFactory.php @@ -503,7 +503,7 @@ class SpecialPageFactory { $wgOut = $context->getOutput(); $wgRequest = $context->getRequest(); $wgUser = $context->getUser(); - $wgLang = $context->getLang(); + $wgLang = $context->getLanguage(); // The useful part $ret = self::executePath( $title, $context, true ); diff --git a/includes/StubObject.php b/includes/StubObject.php index 141de57f9d..3f6b8b1370 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -156,6 +156,6 @@ class StubUserLang extends StubObject { * @return Language */ function _newObject() { - return RequestContext::getMain()->getLang(); + return RequestContext::getMain()->getLanguage(); } } diff --git a/includes/actions/CreditsAction.php b/includes/actions/CreditsAction.php index 17361ccb6b..f28159febc 100644 --- a/includes/actions/CreditsAction.php +++ b/includes/actions/CreditsAction.php @@ -88,7 +88,7 @@ class CreditsAction extends FormlessAction { $timestamp = $article->getTimestamp(); if ( $timestamp ) { - $lang = $this->getLang(); + $lang = $this->getLanguage(); $d = $lang->date( $article->getTimestamp(), true ); $t = $lang->time( $article->getTimestamp(), true ); } else { @@ -143,7 +143,7 @@ class CreditsAction extends FormlessAction { } } - $lang = $this->getLang(); + $lang = $this->getLanguage(); if ( count( $real_names ) ) { $real = $lang->listToText( $real_names ); diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index d2c71a31a2..ac35b0aa19 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -560,7 +560,7 @@ class HistoryPager extends ReverseChronologicalPager { $s .= " $del "; } - $lang = $this->getLang(); + $lang = $this->getLanguage(); $dirmark = $lang->getDirMark(); $s .= " $link"; @@ -646,7 +646,7 @@ class HistoryPager extends ReverseChronologicalPager { * @return String */ function revLink( $rev ) { - $date = $this->getLang()->userTimeAndDate( $rev->getTimestamp(), $this->getUser() ); + $date = $this->getLanguage()->userTimeAndDate( $rev->getTimestamp(), $this->getUser() ); $date = htmlspecialchars( $date ); if ( $rev->userCan( Revision::DELETED_TEXT, $this->getUser() ) ) { $link = Linker::linkKnown( diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index 4854d305cd..715f1f9870 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -68,13 +68,13 @@ class InfoAction extends FormlessAction { ) . Html::rawElement( 'tr', array(), Html::element( 'td', array(), wfMsg( 'pageinfo-edits' ) ) . - Html::element( 'td', array(), $this->getLang()->formatNum( $pageInfo['edits'] ) ) . - Html::element( 'td', array(), $this->getLang()->formatNum( $talkInfo['edits'] ) ) + Html::element( 'td', array(), $this->getLanguage()->formatNum( $pageInfo['edits'] ) ) . + Html::element( 'td', array(), $this->getLanguage()->formatNum( $talkInfo['edits'] ) ) ) . Html::rawElement( 'tr', array(), Html::element( 'td', array(), wfMsg( 'pageinfo-authors' ) ) . - Html::element( 'td', array(), $this->getLang()->formatNum( $pageInfo['authors'] ) ) . - Html::element( 'td', array(), $this->getLang()->formatNum( $talkInfo['authors'] ) ) + Html::element( 'td', array(), $this->getLanguage()->formatNum( $pageInfo['authors'] ) ) . + Html::element( 'td', array(), $this->getLanguage()->formatNum( $talkInfo['authors'] ) ) ) . ( !$this->getUser()->isAllowed( 'unwatchedpages' ) ? '' : Html::rawElement( 'tr', array(), @@ -82,7 +82,7 @@ class InfoAction extends FormlessAction { ) . Html::rawElement( 'tr', array(), Html::element( 'td', array(), wfMsg( 'pageinfo-watchers' ) ) . - Html::element( 'td', array( 'colspan' => 2 ), $this->getLang()->formatNum( $pageInfo['watchers'] ) ) + Html::element( 'td', array( 'colspan' => 2 ), $this->getLanguage()->formatNum( $pageInfo['watchers'] ) ) ) ). ( $wgDisableCounters ? '' : @@ -91,13 +91,13 @@ class InfoAction extends FormlessAction { ) . Html::rawElement( 'tr', array(), Html::element( 'td', array(), wfMsg( 'pageinfo-views' ) ) . - Html::element( 'td', array(), $this->getLang()->formatNum( $pageInfo['views'] ) ) . - Html::element( 'td', array(), $this->getLang()->formatNum( $talkInfo['views'] ) ) + Html::element( 'td', array(), $this->getLanguage()->formatNum( $pageInfo['views'] ) ) . + Html::element( 'td', array(), $this->getLanguage()->formatNum( $talkInfo['views'] ) ) ) . Html::rawElement( 'tr', array(), Html::element( 'td', array(), wfMsg( 'pageinfo-viewsperedit' ) ) . - Html::element( 'td', array(), $this->getLang()->formatNum( sprintf( '%.2f', $pageInfo['edits'] ? $pageInfo['views'] / $pageInfo['edits'] : 0 ) ) ) . - Html::element( 'td', array(), $this->getLang()->formatNum( sprintf( '%.2f', $talkInfo['edits'] ? $talkInfo['views'] / $talkInfo['edits'] : 0 ) ) ) + Html::element( 'td', array(), $this->getLanguage()->formatNum( sprintf( '%.2f', $pageInfo['edits'] ? $pageInfo['views'] / $pageInfo['edits'] : 0 ) ) ) . + Html::element( 'td', array(), $this->getLanguage()->formatNum( sprintf( '%.2f', $talkInfo['edits'] ? $talkInfo['views'] / $talkInfo['edits'] : 0 ) ) ) ) ) ); diff --git a/includes/actions/RevertAction.php b/includes/actions/RevertAction.php index 9c6777a5f4..f002ef1201 100644 --- a/includes/actions/RevertAction.php +++ b/includes/actions/RevertAction.php @@ -95,7 +95,7 @@ class RevertFileAction extends FormAction { 'vertical-label' => true, 'raw' => true, 'default' => wfMsgExt( 'filerevert-intro', 'parse', $this->getTitle()->getText(), - $this->getLang()->date( $timestamp, true ), $this->getLang()->time( $timestamp, true ), + $this->getLanguage()->date( $timestamp, true ), $this->getLanguage()->time( $timestamp, true ), wfExpandUrl( $this->page->getFile()->getArchiveUrl( $this->getRequest()->getText( 'oldimage' ) ), PROTO_CURRENT ) ) @@ -119,8 +119,8 @@ class RevertFileAction extends FormAction { public function onSuccess() { $timestamp = $this->oldFile->getTimestamp(); $this->getOutput()->addHTML( wfMsgExt( 'filerevert-success', 'parse', $this->getTitle()->getText(), - $this->getLang()->date( $timestamp, true ), - $this->getLang()->time( $timestamp, true ), + $this->getLanguage()->date( $timestamp, true ), + $this->getLanguage()->time( $timestamp, true ), wfExpandUrl( $this->page->getFile()->getArchiveUrl( $this->getRequest()->getText( 'oldimage' ) ), PROTO_CURRENT ) ) ); diff --git a/includes/cache/HTMLFileCache.php b/includes/cache/HTMLFileCache.php index 671b15002a..b846e41931 100644 --- a/includes/cache/HTMLFileCache.php +++ b/includes/cache/HTMLFileCache.php @@ -83,7 +83,7 @@ class HTMLFileCache extends FileCacheBase { $user = $context->getUser(); // Check for non-standard user language; this covers uselang, // and extensions for auto-detecting user language. - $ulang = $context->getLang()->getCode(); + $ulang = $context->getLanguage()->getCode(); $clang = $wgContLang->getCode(); // Check that there are no other sources of variation return !$wgShowIPinHeader && !$user->getId() && !$user->getNewtalk() && $ulang == $clang; diff --git a/includes/context/ContextSource.php b/includes/context/ContextSource.php index 6d423e9af2..0eb5d3e339 100644 --- a/includes/context/ContextSource.php +++ b/includes/context/ContextSource.php @@ -96,10 +96,20 @@ abstract class ContextSource implements IContextSource { /** * Get the Language object * + * @deprecated 1.19 Use getLanguage instead * @return Language */ public function getLang() { - return $this->getContext()->getLang(); + return $this->getLanguage(); + } + + /** + * Get the Language object + * + * @return Language + */ + public function getLanguage() { + return $this->getContext()->getLanguage(); } /** diff --git a/includes/context/DerivativeContext.php b/includes/context/DerivativeContext.php index 1ea52a218d..a6a36d74f6 100644 --- a/includes/context/DerivativeContext.php +++ b/includes/context/DerivativeContext.php @@ -172,16 +172,24 @@ class DerivativeContext extends ContextSource { } } + /** + * @deprecated 1.19 Use getLanguage instead + * @return Language + */ + public function getLang() { + $this->getLanguage(); + } + /** * Get the Language object * * @return Language */ - public function getLang() { + public function getLanguage() { if ( !is_null( $this->lang ) ) { return $this->lang; } else { - return $this->getContext()->getLang(); + return $this->getContext()->getLanguage(); } } diff --git a/includes/context/IContextSource.php b/includes/context/IContextSource.php index 12dd1a16e0..4a8e93b15d 100644 --- a/includes/context/IContextSource.php +++ b/includes/context/IContextSource.php @@ -59,10 +59,18 @@ interface IContextSource { /** * Get the Language object * + * @deprecated 1.19 Use getLanguage instead * @return Language */ public function getLang(); + /** + * Get the Language object + * + * @return Language + */ + public function getLanguage(); + /** * Get the Skin object * diff --git a/includes/context/RequestContext.php b/includes/context/RequestContext.php index 3cbe253e3b..631d60d366 100644 --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@ -179,12 +179,20 @@ class RequestContext implements IContextSource { } } + /** + * @deprecated 1.19 Use getLanguage instead + * @return Language + */ + public function getLang() { + return $this->getLanguage(); + } + /** * Get the Language object * * @return Language */ - public function getLang() { + public function getLanguage() { if ( $this->lang === null ) { global $wgLanguageCode, $wgContLang; $code = $this->getRequest()->getVal( diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index a57d4b08ec..6fd2d64227 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -842,7 +842,7 @@ class DifferenceEngine extends ContextSource { * @return String HTML fragment */ private function getRevisionHeader( Revision $rev, $complete = '' ) { - $lang = $this->getLang(); + $lang = $this->getLanguage(); $user = $this->getUser(); $revtimestamp = $rev->getTimestamp(); $timestamp = $lang->userTimeAndDate( $revtimestamp, $user ); diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index 73a39a7d6c..441c22bfdb 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -274,7 +274,7 @@ class LogFormatter { */ protected function msg( $key ) { return wfMessage( $key ) - ->inLanguage( $this->context->getLang() ) + ->inLanguage( $this->context->getLanguage() ) ->title( $this->context->getTitle() ); } @@ -395,13 +395,13 @@ class DeleteLogFormatter extends LogFormatter { foreach ( $extra as $v ) { $changes[] = $this->msg( $v )->plain(); } - $changeText = $this->context->getLang()->listToText( $changes ); + $changeText = $this->context->getLanguage()->listToText( $changes ); $newParams = array_slice( $params, 0, 3 ); $newParams[3] = $changeText; $count = count( explode( ',', $params[$paramStart] ) ); - $newParams[4] = $this->context->getLang()->formatNum( $count ); + $newParams[4] = $this->context->getLanguage()->formatNum( $count ); return $this->parsedParametersDeleteLog = $newParams; } else { return $this->parsedParametersDeleteLog = array_slice( $params, 0, 3 ); @@ -442,7 +442,7 @@ class PatrolLogFormatter extends LogFormatter { $target = $this->entry->getTarget(); $oldid = $params[3]; - $revision = $this->context->getLang()->formatNum( $oldid, true ); + $revision = $this->context->getLanguage()->formatNum( $oldid, true ); if ( $this->plaintext ) { $revlink = $revision; diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 7cf3f741b7..f26a2e4d8e 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -232,7 +232,7 @@ class ParserOptions { * @return ParserOptions object */ public static function newFromContext( IContextSource $context ) { - return new ParserOptions( $context->getUser(), $context->getLang() ); + return new ParserOptions( $context->getUser(), $context->getLanguage() ); } /** Get user options */ diff --git a/includes/revisiondelete/RevisionDelete.php b/includes/revisiondelete/RevisionDelete.php index 0ba6675cc3..1504ffa165 100644 --- a/includes/revisiondelete/RevisionDelete.php +++ b/includes/revisiondelete/RevisionDelete.php @@ -193,7 +193,7 @@ class RevDel_RevisionItem extends RevDel_Item { * Overridden by RevDel_ArchiveItem. */ protected function getRevisionLink() { - $date = $this->list->getLang()->timeanddate( $this->revision->getTimestamp(), true ); + $date = $this->list->getLanguage()->timeanddate( $this->revision->getTimestamp(), true ); if ( $this->isDeleted() && !$this->canViewContent() ) { return $date; } @@ -340,7 +340,7 @@ class RevDel_ArchiveItem extends RevDel_RevisionItem { protected function getRevisionLink() { $undelete = SpecialPage::getTitleFor( 'Undelete' ); - $date = $this->list->getLang()->timeanddate( $this->revision->getTimestamp(), true ); + $date = $this->list->getLanguage()->timeanddate( $this->revision->getTimestamp(), true ); if ( $this->isDeleted() && !$this->canViewContent() ) { return $date; } @@ -571,7 +571,7 @@ class RevDel_FileItem extends RevDel_Item { * Overridden by RevDel_ArchivedFileItem. */ protected function getLink() { - $date = $this->list->getLang()->timeanddate( $this->file->getTimestamp(), true ); + $date = $this->list->getLanguage()->timeanddate( $this->file->getTimestamp(), true ); if ( $this->isDeleted() ) { # Hidden files... if ( !$this->canViewContent() ) { @@ -634,11 +634,11 @@ class RevDel_FileItem extends RevDel_Item { $data = wfMsg( 'widthheight', - $this->list->getLang()->formatNum( $this->file->getWidth() ), - $this->list->getLang()->formatNum( $this->file->getHeight() ) + $this->list->getLanguage()->formatNum( $this->file->getWidth() ), + $this->list->getLanguage()->formatNum( $this->file->getHeight() ) ) . ' (' . - wfMsgExt( 'nbytes', 'parsemag', $this->list->getLang()->formatNum( $this->file->getSize() ) ) . + wfMsgExt( 'nbytes', 'parsemag', $this->list->getLanguage()->formatNum( $this->file->getSize() ) ) . ')'; return '
  • ' . $this->getLink() . ' ' . $this->getUserTools() . ' ' . @@ -722,7 +722,7 @@ class RevDel_ArchivedFileItem extends RevDel_FileItem { } protected function getLink() { - $date = $this->list->getLang()->timeanddate( $this->file->getTimestamp(), true ); + $date = $this->list->getLanguage()->timeanddate( $this->file->getTimestamp(), true ); $undelete = SpecialPage::getTitleFor( 'Undelete' ); $key = $this->file->getKey(); # Hidden files... @@ -847,7 +847,7 @@ class RevDel_LogItem extends RevDel_Item { } public function getHTML() { - $date = htmlspecialchars( $this->list->getLang()->timeanddate( $this->row->log_timestamp ) ); + $date = htmlspecialchars( $this->list->getLanguage()->timeanddate( $this->row->log_timestamp ) ); $paramArray = LogPage::extractParams( $this->row->log_params ); $title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title ); @@ -875,7 +875,7 @@ class RevDel_LogItem extends RevDel_Item { $userLink = '' . $userLink . ''; } // Comment - $comment = $this->list->getLang()->getDirMark() . Linker::commentBlock( $this->row->log_comment ); + $comment = $this->list->getLanguage()->getDirMark() . Linker::commentBlock( $this->row->log_comment ); if( LogEventsList::isDeleted($this->row,LogPage::DELETED_COMMENT) ) { $comment = '' . $comment . ''; } diff --git a/includes/specials/SpecialActiveusers.php b/includes/specials/SpecialActiveusers.php index 60b3a5d5a5..7b6590332f 100644 --- a/includes/specials/SpecialActiveusers.php +++ b/includes/specials/SpecialActiveusers.php @@ -119,7 +119,7 @@ class ActiveUsersPager extends UsersPager { $ulinks = Linker::userLink( $row->user_id, $userName ); $ulinks .= Linker::userToolLinks( $row->user_id, $userName ); - $lang = $this->getLang(); + $lang = $this->getLanguage(); $list = array(); foreach( self::getGroups( $row->user_id ) as $group ) { @@ -190,7 +190,7 @@ class SpecialActiveUsers extends SpecialPage { $out = $this->getOutput(); $out->wrapWikiMsg( "
    \n$1\n
    ", - array( 'activeusers-intro', $this->getLang()->formatNum( $wgActiveUserDays ) ) ); + array( 'activeusers-intro', $this->getLanguage()->formatNum( $wgActiveUserDays ) ) ); $up = new ActiveUsersPager( $this->getContext() ); diff --git a/includes/specials/SpecialAllmessages.php b/includes/specials/SpecialAllmessages.php index 5ab48ddc2b..da23f5bbe1 100644 --- a/includes/specials/SpecialAllmessages.php +++ b/includes/specials/SpecialAllmessages.php @@ -126,7 +126,7 @@ class AllmessagesTablePager extends TablePager { $this->custom = ($request->getVal( 'filter' ) == 'unmodified'); } - $prefix = $this->getLang()->ucfirst( $request->getVal( 'prefix', '' ) ); + $prefix = $this->getLanguage()->ucfirst( $request->getVal( 'prefix', '' ) ); $prefix = $prefix != '' ? Title::makeTitleSafe( NS_MEDIAWIKI, $request->getVal( 'prefix', null ) ) : null; if( $prefix !== null ){ $this->displayPrefix = $prefix->getDBkey(); @@ -350,11 +350,11 @@ class AllmessagesTablePager extends TablePager { $talk = Title::makeTitle( NS_MEDIAWIKI_TALK, $value . $this->suffix ); if( $this->mCurrentRow->am_customised ){ - $title = Linker::linkKnown( $title, $this->getLang()->lcfirst( $value ) ); + $title = Linker::linkKnown( $title, $this->getLanguage()->lcfirst( $value ) ); } else { $title = Linker::link( $title, - $this->getLang()->lcfirst( $value ), + $this->getLanguage()->lcfirst( $value ), array(), array(), array( 'broken' ) @@ -403,7 +403,7 @@ class AllmessagesTablePager extends TablePager { $arr['class'] = 'allmessages-customised'; } if( !$isSecond ){ - $arr['id'] = Sanitizer::escapeId( 'msg_' . $this->getLang()->lcfirst( $row->am_title ) ); + $arr['id'] = Sanitizer::escapeId( 'msg_' . $this->getLanguage()->lcfirst( $row->am_title ) ); } return $arr; } diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index 8cf9333e36..bd83b55c0f 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -425,7 +425,7 @@ class SpecialAllpages extends IncludableSpecialPage { array(), $query ); - $out2 = $this->getLang()->pipeList( array( $out2, $prevLink ) ); + $out2 = $this->getLanguage()->pipeList( array( $out2, $prevLink ) ); } if( $n == $this->maxPerPage && $s = $res->fetchObject() ) { @@ -442,7 +442,7 @@ class SpecialAllpages extends IncludableSpecialPage { array(), $query ); - $out2 = $this->getLang()->pipeList( array( $out2, $nextLink ) ); + $out2 = $this->getLanguage()->pipeList( array( $out2, $nextLink ) ); } $out2 .= ""; } @@ -457,7 +457,7 @@ class SpecialAllpages extends IncludableSpecialPage { $output->addHTML( Html::element( 'hr' ) . Html::rawElement( 'div', array( 'class' => 'mw-allpages-nav' ), - $this->getLang()->pipeList( $links ) + $this->getLanguage()->pipeList( $links ) ) ); } diff --git a/includes/specials/SpecialAncientpages.php b/includes/specials/SpecialAncientpages.php index 90273747c4..1203e1fd9c 100644 --- a/includes/specials/SpecialAncientpages.php +++ b/includes/specials/SpecialAncientpages.php @@ -61,12 +61,12 @@ class AncientPagesPage extends QueryPage { function formatResult( $skin, $result ) { global $wgContLang; - $d = $this->getLang()->userTimeAndDate( $result->value, $this->getUser() ); + $d = $this->getLanguage()->userTimeAndDate( $result->value, $this->getUser() ); $title = Title::makeTitle( $result->namespace, $result->title ); $link = Linker::linkKnown( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); - return $this->getLang()->specialList( $link, htmlspecialchars( $d ) ); + return $this->getLanguage()->specialList( $link, htmlspecialchars( $d ) ); } } diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index f35709f54c..fab295ac08 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -377,7 +377,7 @@ class SpecialBlock extends FormSpecialPage { $text = Html::rawElement( 'p', array( 'class' => 'mw-ipb-conveniencelinks' ), - $this->getLang()->pipeList( $links ) + $this->getLanguage()->pipeList( $links ) ); if( $this->target instanceof User ){ diff --git a/includes/specials/SpecialBlockList.php b/includes/specials/SpecialBlockList.php index 9891e289f5..f0617b7b35 100644 --- a/includes/specials/SpecialBlockList.php +++ b/includes/specials/SpecialBlockList.php @@ -252,7 +252,7 @@ class BlockListPager extends TablePager { switch( $name ) { case 'ipb_timestamp': - $formatted = $this->getLang()->timeanddate( $value, /* User preference timezone */ true ); + $formatted = $this->getLanguage()->timeanddate( $value, /* User preference timezone */ true ); break; case 'ipb_target': @@ -278,7 +278,7 @@ class BlockListPager extends TablePager { break; case 'ipb_expiry': - $formatted = $this->getLang()->formatExpiry( $value, /* User preference timezone */ true ); + $formatted = $this->getLanguage()->formatExpiry( $value, /* User preference timezone */ true ); if( $this->getUser()->isAllowed( 'block' ) ){ if( $row->ipb_auto ){ $links[] = Linker::linkKnown( @@ -300,7 +300,7 @@ class BlockListPager extends TablePager { $formatted .= ' ' . Html::rawElement( 'span', array( 'class' => 'mw-blocklist-actions' ), - wfMsg( 'parentheses', $this->getLang()->pipeList( $links ) ) + wfMsg( 'parentheses', $this->getLanguage()->pipeList( $links ) ) ); } break; @@ -338,7 +338,7 @@ class BlockListPager extends TablePager { $properties[] = $msg['blocklist-nousertalk']; } - $formatted = $this->getLang()->commaList( $properties ); + $formatted = $this->getLanguage()->commaList( $properties ); break; default: diff --git a/includes/specials/SpecialBrokenRedirects.php b/includes/specials/SpecialBrokenRedirects.php index cf36ae77ca..5279481245 100644 --- a/includes/specials/SpecialBrokenRedirects.php +++ b/includes/specials/SpecialBrokenRedirects.php @@ -114,7 +114,7 @@ class BrokenRedirectsPage extends PageQueryPage { array(), array( 'broken' ) ); - $arr = $this->getLang()->getArrow(); + $arr = $this->getLanguage()->getArrow(); $out = $from . $this->msg( 'word-separator' )->escaped(); @@ -127,7 +127,7 @@ class BrokenRedirectsPage extends PageQueryPage { ); } - $out .= $this->msg( 'parentheses' )->rawParams( $this->getLang()->pipeList( $links ) )->escaped(); + $out .= $this->msg( 'parentheses' )->rawParams( $this->getLanguage()->pipeList( $links ) )->escaped(); $out .= " {$arr} {$to}"; return $out; } diff --git a/includes/specials/SpecialCategories.php b/includes/specials/SpecialCategories.php index a2b569506d..6d2831c7b0 100644 --- a/includes/specials/SpecialCategories.php +++ b/includes/specials/SpecialCategories.php @@ -115,7 +115,7 @@ class CategoryPager extends AlphabeticPager { $title = Title::makeTitle( NS_CATEGORY, $result->cat_title ); $titleText = Linker::link( $title, htmlspecialchars( $title->getText() ) ); $count = $this->msg( 'nmembers' )->numParams( $result->cat_pages )->escaped(); - return Xml::tags( 'li', null, $this->getLang()->specialList( $titleText, $count ) ) . "\n"; + return Xml::tags( 'li', null, $this->getLanguage()->specialList( $titleText, $count ) ) . "\n"; } public function getStartForm( $from ) { diff --git a/includes/specials/SpecialChangePassword.php b/includes/specials/SpecialChangePassword.php index 9fe624201c..3ef842b123 100644 --- a/includes/specials/SpecialChangePassword.php +++ b/includes/specials/SpecialChangePassword.php @@ -125,7 +125,7 @@ class SpecialChangePassword extends UnlistedSpecialPage { '' . '' . Xml::checkLabel( - wfMsgExt( 'remembermypassword', 'parsemag', $this->getLang()->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) ), + wfMsgExt( 'remembermypassword', 'parsemag', $this->getLanguage()->formatNum( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) ), 'wpRemember', 'wpRemember', $this->getRequest()->getCheck( 'wpRemember' ) ) . '' . diff --git a/includes/specials/SpecialConfirmemail.php b/includes/specials/SpecialConfirmemail.php index 49c3c4ebd9..4a10b38dba 100644 --- a/includes/specials/SpecialConfirmemail.php +++ b/includes/specials/SpecialConfirmemail.php @@ -87,9 +87,9 @@ class EmailConfirmation extends UnlistedSpecialPage { // date and time are separate parameters to facilitate localisation. // $time is kept for backward compat reasons. // 'emailauthenticated' is also used in SpecialPreferences.php - $time = $this->getLang()->timeAndDate( $user->mEmailAuthenticated, true ); - $d = $this->getLang()->date( $user->mEmailAuthenticated, true ); - $t = $this->getLang()->time( $user->mEmailAuthenticated, true ); + $time = $this->getLanguage()->timeAndDate( $user->mEmailAuthenticated, true ); + $d = $this->getLanguage()->date( $user->mEmailAuthenticated, true ); + $t = $this->getLanguage()->time( $user->mEmailAuthenticated, true ); $out->addWikiMsg( 'emailauthenticated', $time, $d, $t ); } if( $user->isEmailConfirmationPending() ) { diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 6c732cb344..a6741bf0bb 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -222,7 +222,7 @@ class SpecialContributions extends SpecialPage { $talk = $userObj->getTalkPage(); if( $talk ) { $tools = self::getUserLinks( $nt, $talk, $userObj, $this->getUser() ); - $links = $this->getLang()->pipeList( $tools ); + $links = $this->getLanguage()->pipeList( $tools ); // Show a note if the user is blocked and display the last block log entry. if ( $userObj->isBlocked() ) { @@ -674,8 +674,8 @@ class ContribsPager extends ReverseChronologicalPager { $chardiff = ' '; } - $comment = $this->getLang()->getDirMark() . Linker::revComment( $rev, false, true ); - $date = $this->getLang()->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true ); + $comment = $this->getLanguage()->getDirMark() . Linker::revComment( $rev, false, true ); + $date = $this->getLanguage()->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true ); if( $rev->userCan( Revision::DELETED_TEXT, $user ) ) { $d = Linker::linkKnown( $page, diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 1b1ac163b9..c35bf14a49 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -95,7 +95,7 @@ class DeletedContribsPager extends IndexPager { if ( isset( $this->mNavigationBar ) ) { return $this->mNavigationBar; } - $lang = $this->getLang(); + $lang = $this->getLanguage(); $fmtLimit = $lang->formatNum( $this->mLimit ); $linkTexts = array( 'prev' => wfMsgExt( 'pager-newer-n', array( 'escape', 'parsemag' ), $fmtLimit ), @@ -182,7 +182,7 @@ class DeletedContribsPager extends IndexPager { } $comment = Linker::revComment( $rev ); - $date = htmlspecialchars( $this->getLang()->timeanddate( $rev->getTimestamp(), true ) ); + $date = htmlspecialchars( $this->getLanguage()->timeanddate( $rev->getTimestamp(), true ) ); if( !$user->isAllowed( 'undelete' ) || !$rev->userCan( Revision::DELETED_TEXT, $user ) ) { $link = $date; // unusable link @@ -217,7 +217,7 @@ class DeletedContribsPager extends IndexPager { $tools = Html::rawElement( 'span', array( 'class' => 'mw-deletedcontribs-tools' ), - wfMsg( 'parentheses', $this->getLang()->pipeList( array( $last, $dellog, $reviewlink ) ) ) + wfMsg( 'parentheses', $this->getLanguage()->pipeList( array( $last, $dellog, $reviewlink ) ) ) ); $ret = "{$del}{$link} {$tools} . . {$mflag} {$pagelink} {$comment}"; @@ -412,7 +412,7 @@ class DeletedContributionsPage extends SpecialPage { wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) ); - $links = $this->getLang()->pipeList( $tools ); + $links = $this->getLanguage()->pipeList( $tools ); // Show a note if the user is blocked and display the last block log entry. if ( $userObj->isBlocked() ) { diff --git a/includes/specials/SpecialDisambiguations.php b/includes/specials/SpecialDisambiguations.php index 51cb4dbb44..8b7f66799c 100644 --- a/includes/specials/SpecialDisambiguations.php +++ b/includes/specials/SpecialDisambiguations.php @@ -128,7 +128,7 @@ class DisambiguationsPage extends PageQueryPage { $from = Linker::link( $title ); $edit = Linker::link( $title, wfMsgExt( 'parentheses', array( 'escape' ), wfMsg( 'editlink' ) ) , array(), array( 'redirect' => 'no', 'action' => 'edit' ) ); - $arr = $this->getLang()->getArrow(); + $arr = $this->getLanguage()->getArrow(); $to = Linker::link( $dp ); return "$from $edit $arr $to"; diff --git a/includes/specials/SpecialDoubleRedirects.php b/includes/specials/SpecialDoubleRedirects.php index 7dd337d5d9..78f5531f7e 100644 --- a/includes/specials/SpecialDoubleRedirects.php +++ b/includes/specials/SpecialDoubleRedirects.php @@ -121,7 +121,7 @@ class DoubleRedirectsPage extends PageQueryPage { $linkC = Linker::linkKnown( $titleC ); - $lang = $this->getLang(); + $lang = $this->getLanguage(); $arr = $lang->getArrow() . $lang->getDirMark(); return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" ); diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index e305ff8a6a..80c6ee86eb 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -137,7 +137,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { if( count( $toWatch ) > 0 ) { $this->successMessage .= ' ' . wfMessage( 'watchlistedit-raw-added', - $this->getLang()->formatNum( count( $toWatch ) ) + $this->getLanguage()->formatNum( count( $toWatch ) ) ); $this->showTitles( $toWatch, $this->successMessage ); } @@ -145,7 +145,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { if( count( $toUnwatch ) > 0 ) { $this->successMessage .= ' ' . wfMessage( 'watchlistedit-raw-removed', - $this->getLang()->formatNum( count( $toUnwatch ) ) + $this->getLanguage()->formatNum( count( $toUnwatch ) ) ); $this->showTitles( $toUnwatch, $this->successMessage ); } @@ -161,7 +161,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { $this->successMessage .= ' ' . wfMessage( 'watchlistedit-raw-removed', - $this->getLang()->formatNum( count( $current ) ) + $this->getLanguage()->formatNum( count( $current ) ) ); $this->showTitles( $current, $this->successMessage ); } @@ -360,7 +360,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { if( count( $removed ) > 0 ) { $this->successMessage = wfMessage( 'watchlistedit-normal-done', - $this->getLang()->formatNum( count( $removed ) ) + $this->getLanguage()->formatNum( count( $removed ) ) ); $this->showTitles( $removed, $this->successMessage ); return true; @@ -417,7 +417,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { ? wfMsgHtml( 'blanknamespace' ) : htmlspecialchars( $wgContLang->getFormattedNsText( $ns ) ); $this->toc .= Linker::tocLine( "mw-htmlform-{$data['section']}", $nsText, - $this->getLang()->formatNum( ++$tocLength ), 1 ) . Linker::tocLineEnd(); + $this->getLanguage()->formatNum( ++$tocLength ), 1 ) . Linker::tocLineEnd(); } $this->toc = Linker::tocList( $this->toc ); } else { @@ -463,7 +463,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { wfRunHooks( 'WatchlistEditorBuildRemoveLine', array( &$tools, $title, $title->isRedirect(), $this->getSkin() ) ); - return $link . " (" . $this->getLang()->pipeList( $tools ) . ")"; + return $link . " (" . $this->getLanguage()->pipeList( $tools ) . ")"; } /** @@ -557,7 +557,7 @@ class EditWatchlistNormalHTMLForm extends HTMLForm { $namespace = substr( $namespace, 2 ); return $namespace == NS_MAIN ? wfMsgHtml( 'blanknamespace' ) - : htmlspecialchars( $this->getContext()->getLang()->getFormattedNsText( $namespace ) ); + : htmlspecialchars( $this->getContext()->getLanguage()->getFormattedNsText( $namespace ) ); } } diff --git a/includes/specials/SpecialFewestrevisions.php b/includes/specials/SpecialFewestrevisions.php index a59f78f94e..27d17f632c 100644 --- a/includes/specials/SpecialFewestrevisions.php +++ b/includes/specials/SpecialFewestrevisions.php @@ -90,6 +90,6 @@ class FewestrevisionsPage extends QueryPage { array( 'action' => 'history' ) ) . $redirect; - return $this->getLang()->specialList( $plink, $nlink ); + return $this->getLanguage()->specialList( $plink, $nlink ); } } diff --git a/includes/specials/SpecialFileDuplicateSearch.php b/includes/specials/SpecialFileDuplicateSearch.php index 0a7a6efb11..8f66b5c73a 100644 --- a/includes/specials/SpecialFileDuplicateSearch.php +++ b/includes/specials/SpecialFileDuplicateSearch.php @@ -133,9 +133,9 @@ class FileDuplicateSearchPage extends QueryPage { $out->addHTML( '
    ' . $thumb->toHtml( array( 'desc-link' => false ) ) . '
    ' . wfMsgExt( 'fileduplicatesearch-info', array( 'parse' ), - $this->getLang()->formatNum( $img->getWidth() ), - $this->getLang()->formatNum( $img->getHeight() ), - $this->getLang()->formatSize( $img->getSize() ), + $this->getLanguage()->formatNum( $img->getWidth() ), + $this->getLanguage()->formatNum( $img->getHeight() ), + $this->getLanguage()->formatSize( $img->getSize() ), $img->getMimeType() ) . '
    ' ); @@ -155,7 +155,7 @@ class FileDuplicateSearchPage extends QueryPage { $out->wrapWikiMsg( "

    \n$1\n

    ", array( 'fileduplicatesearch-result-n', wfEscapeWikiText( $this->filename ), - $this->getLang()->formatNum( $numRows - 1 ) ) + $this->getLanguage()->formatNum( $numRows - 1 ) ) ); } @@ -181,7 +181,7 @@ class FileDuplicateSearchPage extends QueryPage { $userText = $result->getUser( 'text' ); $user = Linker::link( Title::makeTitle( NS_USER, $userText ), $userText ); - $time = $this->getLang()->timeanddate( $result->getTimestamp() ); + $time = $this->getLanguage()->timeanddate( $result->getTimestamp() ); return "$plink . . $user . . $time"; } diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index c5e944a5dc..e8c5762d2c 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -354,7 +354,7 @@ class ImportReporter extends ContextSource { $this->mPageCount++; - $localCount = $this->getLang()->formatNum( $successCount ); + $localCount = $this->getLanguage()->formatNum( $successCount ); $contentCount = $wgContLang->formatNum( $successCount ); if( $successCount > 0 ) { @@ -403,7 +403,7 @@ class ImportReporter extends ContextSource { $out = $this->getOutput(); if ( $this->mLogItemCount > 0 ) { $msg = wfMsgExt( 'imported-log-entries', 'parseinline', - $this->getLang()->formatNum( $this->mLogItemCount ) ); + $this->getLanguage()->formatNum( $this->mLogItemCount ) ); $out->addHTML( Xml::tags( 'li', null, $msg ) ); } elseif( $this->mPageCount == 0 && $this->mLogItemCount == 0 ) { $out->addHTML( "\n" ); diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php index a37bdecd7e..eb42206b9a 100644 --- a/includes/specials/SpecialLinkSearch.php +++ b/includes/specials/SpecialLinkSearch.php @@ -82,7 +82,7 @@ class LinkSearchPage extends QueryPage { $protocol = ''; } - $out->addWikiMsg( 'linksearch-text', '' . $this->getLang()->commaList( $wgUrlProtocols ) . '' ); + $out->addWikiMsg( 'linksearch-text', '' . $this->getLanguage()->commaList( $wgUrlProtocols ) . '' ); $s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) . Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) . '
    ' . diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index 1e73fefab6..b57549919e 100644 --- a/includes/specials/SpecialListfiles.php +++ b/includes/specials/SpecialListfiles.php @@ -198,7 +198,7 @@ class ImageListPager extends TablePager { $thumb = $file->transform( array( 'width' => 180, 'height' => 360 ) ); return $thumb->toHtml( array( 'desc-link' => true ) ); case 'img_timestamp': - return htmlspecialchars( $this->getLang()->timeanddate( $value, true ) ); + return htmlspecialchars( $this->getLanguage()->timeanddate( $value, true ) ); case 'img_name': static $imgfile = null; if ( $imgfile === null ) $imgfile = wfMsg( 'imgfile' ); @@ -226,7 +226,7 @@ class ImageListPager extends TablePager { } return $link; case 'img_size': - return htmlspecialchars( $this->getLang()->formatSize( $value ) ); + return htmlspecialchars( $this->getLanguage()->formatSize( $value ) ); case 'img_description': return Linker::commentBlock( $value ); case 'count': diff --git a/includes/specials/SpecialListgrouprights.php b/includes/specials/SpecialListgrouprights.php index 00bab56859..91d8ed8772 100644 --- a/includes/specials/SpecialListgrouprights.php +++ b/includes/specials/SpecialListgrouprights.php @@ -169,7 +169,7 @@ class SpecialListGroupRights extends SpecialPage { } } sort( $r ); - $lang = $this->getLang(); + $lang = $this->getLanguage(); if( $add === true ){ $r[] = wfMsgExt( 'listgrouprights-addgroup-all', array( 'escape' ) ); } elseif( is_array( $add ) && count( $add ) ) { diff --git a/includes/specials/SpecialListredirects.php b/includes/specials/SpecialListredirects.php index 1a9f601279..1a25d6c647 100644 --- a/includes/specials/SpecialListredirects.php +++ b/includes/specials/SpecialListredirects.php @@ -109,7 +109,7 @@ class ListredirectsPage extends QueryPage { $target = $this->getRedirectTarget( $result ); if( $target ) { # Make a link to the destination page - $lang = $this->getLang(); + $lang = $this->getLanguage(); $arr = $lang->getArrow() . $lang->getDirMark(); $targetLink = Linker::link( $target ); return "$rd_link $arr $targetLink"; diff --git a/includes/specials/SpecialListusers.php b/includes/specials/SpecialListusers.php index a4890a1481..b1ff6ea705 100644 --- a/includes/specials/SpecialListusers.php +++ b/includes/specials/SpecialListusers.php @@ -131,7 +131,7 @@ class UsersPager extends AlphabeticPager { $userPage = Title::makeTitle( NS_USER, $row->user_name ); $name = Linker::link( $userPage, htmlspecialchars( $userPage->getText() ) ); - $lang = $this->getLang(); + $lang = $this->getLanguage(); $groups_list = self::getGroups( $row->user_id ); if( count( $groups_list ) > 0 ) { diff --git a/includes/specials/SpecialMIMEsearch.php b/includes/specials/SpecialMIMEsearch.php index b06a95bdf1..2ce8ec4ff5 100644 --- a/includes/specials/SpecialMIMEsearch.php +++ b/includes/specials/SpecialMIMEsearch.php @@ -94,7 +94,7 @@ class MIMEsearchPage extends QueryPage { ); $download = Linker::makeMediaLinkObj( $nt, wfMsgHtml( 'download' ) ); - $lang = $this->getLang(); + $lang = $this->getLanguage(); $bytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), $lang->formatNum( $result->img_size ) ); $dimensions = htmlspecialchars( wfMsg( 'widthheight', diff --git a/includes/specials/SpecialMergeHistory.php b/includes/specials/SpecialMergeHistory.php index e0dd331f83..19650da95b 100644 --- a/includes/specials/SpecialMergeHistory.php +++ b/includes/specials/SpecialMergeHistory.php @@ -253,7 +253,7 @@ class SpecialMergeHistory extends SpecialPage { $pageLink = Linker::linkKnown( $rev->getTitle(), - htmlspecialchars( $this->getLang()->timeanddate( $ts ) ), + htmlspecialchars( $this->getLanguage()->timeanddate( $ts ) ), array(), array( 'oldid' => $rev->getId() ) ); diff --git a/includes/specials/SpecialMostcategories.php b/includes/specials/SpecialMostcategories.php index f75b5212b0..98b736756d 100644 --- a/includes/specials/SpecialMostcategories.php +++ b/includes/specials/SpecialMostcategories.php @@ -62,6 +62,6 @@ class MostcategoriesPage extends QueryPage { $count = $this->msg( 'ncategories' )->numParams( $result->value )->escaped(); $link = Linker::link( $title ); - return $this->getLang()->specialList( $link, $count ); + return $this->getLanguage()->specialList( $link, $count ); } } diff --git a/includes/specials/SpecialMostlinked.php b/includes/specials/SpecialMostlinked.php index 390049fd8f..a16f0872b5 100644 --- a/includes/specials/SpecialMostlinked.php +++ b/includes/specials/SpecialMostlinked.php @@ -99,6 +99,6 @@ class MostlinkedPage extends QueryPage { $link = Linker::link( $title ); $wlh = $this->makeWlhLink( $title, $this->msg( 'nlinks' )->numParams( $result->value )->escaped() ); - return $this->getLang()->specialList( $link, $wlh ); + return $this->getLanguage()->specialList( $link, $wlh ); } } diff --git a/includes/specials/SpecialMostlinkedcategories.php b/includes/specials/SpecialMostlinkedcategories.php index 9cbc936af7..7fb9dea998 100644 --- a/includes/specials/SpecialMostlinkedcategories.php +++ b/includes/specials/SpecialMostlinkedcategories.php @@ -82,6 +82,6 @@ class MostlinkedCategoriesPage extends QueryPage { $plink = Linker::link( $nt, htmlspecialchars( $text ) ); $nlinks = $this->msg( 'nmembers' )->numParams( $result->value )->escaped(); - return $this->getLang()->specialList( $plink, $nlinks ); + return $this->getLanguage()->specialList( $plink, $nlinks ); } } diff --git a/includes/specials/SpecialMostlinkedtemplates.php b/includes/specials/SpecialMostlinkedtemplates.php index 406173a7aa..6fb094260b 100644 --- a/includes/specials/SpecialMostlinkedtemplates.php +++ b/includes/specials/SpecialMostlinkedtemplates.php @@ -98,7 +98,7 @@ class MostlinkedTemplatesPage extends QueryPage { public function formatResult( $skin, $result ) { $title = Title::makeTitle( $result->namespace, $result->title ); - return $this->getLang()->specialList( + return $this->getLanguage()->specialList( Linker::link( $title ), $this->makeWlhLink( $title, $result ) ); diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index e3003da661..5eb0247e3d 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -304,7 +304,7 @@ class MovePageForm extends UnlistedSpecialPage { ? 'move-subpages' : 'move-talk-subpages' ), array( 'parseinline' ), - $this->getLang()->formatNum( $wgMaximumMovedPages ), + $this->getLanguage()->formatNum( $wgMaximumMovedPages ), # $2 to allow use of PLURAL in message. $wgMaximumMovedPages ) @@ -366,7 +366,7 @@ class MovePageForm extends UnlistedSpecialPage { # Disallow deletions of big articles $bigHistory = $page->isBigDeletion(); if( $bigHistory && count( $nt->getUserPermissionsErrors( 'bigdelete', $user ) ) ) { - $this->showForm( array( 'delete-toobig', $this->getLang()->formatNum( $wgDeleteRevisionsLimit ) ) ); + $this->showForm( array( 'delete-toobig', $this->getLanguage()->formatNum( $wgDeleteRevisionsLimit ) ) ); return; } @@ -553,7 +553,7 @@ class MovePageForm extends UnlistedSpecialPage { $extraOutput []= wfMsgHtml( 'movepage-page-moved', $oldLink, $newLink ); ++$count; if( $count >= $wgMaximumMovedPages ) { - $extraOutput []= wfMsgExt( 'movepage-max-pages', array( 'parsemag', 'escape' ), $this->getLang()->formatNum( $wgMaximumMovedPages ) ); + $extraOutput []= wfMsgExt( 'movepage-max-pages', array( 'parsemag', 'escape' ), $this->getLanguage()->formatNum( $wgMaximumMovedPages ) ); break; } } else { @@ -608,7 +608,7 @@ class MovePageForm extends UnlistedSpecialPage { return; } - $out->addWikiMsg( 'movesubpagetext', $this->getLang()->formatNum( $count ) ); + $out->addWikiMsg( 'movesubpagetext', $this->getLanguage()->formatNum( $count ) ); $out->addHTML( "
      \n" ); foreach( $subpages as $subpage ) { diff --git a/includes/specials/SpecialNewimages.php b/includes/specials/SpecialNewimages.php index 99a17f2074..5dc951eb4e 100644 --- a/includes/specials/SpecialNewimages.php +++ b/includes/specials/SpecialNewimages.php @@ -115,7 +115,7 @@ class NewFilesPager extends ReverseChronologicalPager { $this->gallery->add( $title, "$ul
      \n" - . htmlspecialchars( $this->getLang()->timeanddate( $row->img_timestamp, true ) ) + . htmlspecialchars( $this->getLanguage()->timeanddate( $row->img_timestamp, true ) ) . "
      \n" ); } diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 3b50f83688..ecec87de53 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -111,7 +111,7 @@ class SpecialNewpages extends IncludableSpecialPage { $this->opts->setValue( 'username', $m[1] ); } if ( preg_match( '/^namespace=(.*)$/', $bit, $m ) ) { - $ns = $this->getLang()->getNsIndex( $m[1] ); + $ns = $this->getLanguage()->getNsIndex( $m[1] ); if( $ns !== false ) { $this->opts->setValue( 'namespace', $ns ); } @@ -200,7 +200,7 @@ class SpecialNewpages extends IncludableSpecialPage { $links[$key] = wfMsgHtml( $msg, $link ); } - return $this->getLang()->pipeList( $links ); + return $this->getLanguage()->pipeList( $links ); } protected function form() { @@ -294,7 +294,7 @@ class SpecialNewpages extends IncludableSpecialPage { $classes = array(); - $lang = $this->getLang(); + $lang = $this->getLanguage(); $dm = $lang->getDirMark(); $title = Title::newFromRow( $result ); diff --git a/includes/specials/SpecialPopularpages.php b/includes/specials/SpecialPopularpages.php index 63a3267b55..803f03e7f4 100644 --- a/includes/specials/SpecialPopularpages.php +++ b/includes/specials/SpecialPopularpages.php @@ -62,6 +62,6 @@ class PopularPagesPage extends QueryPage { htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); $nv = $this->msg( 'nviews' )->numParams( $result->value )->escaped(); - return $this->getLang()->specialList( $link, $nv ); + return $this->getLanguage()->specialList( $link, $nv ); } } diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index 7c96faa902..eec974fe0f 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -97,7 +97,7 @@ class SpecialProtectedpages extends SpecialPage { } $stxt = ''; - $lang = $this->getLang(); + $lang = $this->getLanguage(); $expiry = $lang->formatExpiry( $row->pr_expiry, TS_MW ); if( $expiry != $infinity ) { diff --git a/includes/specials/SpecialProtectedtitles.php b/includes/specials/SpecialProtectedtitles.php index 81f3812ef1..982feb661b 100644 --- a/includes/specials/SpecialProtectedtitles.php +++ b/includes/specials/SpecialProtectedtitles.php @@ -90,7 +90,7 @@ class SpecialProtectedtitles extends SpecialPage { $description_items[] = $protType; - $lang = $this->getLang(); + $lang = $this->getLanguage(); $expiry = strlen( $row->pt_expiry ) ? $lang->formatExpiry( $row->pt_expiry, TS_MW ) : $infinity; if( $expiry != $infinity ) { $expiry_description = wfMsg( diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index c6b123b0da..85b93b0910 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -774,10 +774,10 @@ class SpecialRecentChanges extends IncludableSpecialPage { } if( $options['from'] ) { $note .= wfMsgExt( 'rcnotefrom', array( 'parseinline' ), - $this->getLang()->formatNum( $options['limit'] ), - $this->getLang()->timeanddate( $options['from'], true ), - $this->getLang()->date( $options['from'], true ), - $this->getLang()->time( $options['from'], true ) ) . '
      '; + $this->getLanguage()->formatNum( $options['limit'] ), + $this->getLanguage()->timeanddate( $options['from'], true ), + $this->getLanguage()->date( $options['from'], true ), + $this->getLanguage()->time( $options['from'], true ) ) . '
      '; } # Sort data for display and make sure it's unique after we've added user data. @@ -790,17 +790,17 @@ class SpecialRecentChanges extends IncludableSpecialPage { // limit links foreach( $wgRCLinkLimits as $value ) { - $cl[] = $this->makeOptionsLink( $this->getLang()->formatNum( $value ), + $cl[] = $this->makeOptionsLink( $this->getLanguage()->formatNum( $value ), array( 'limit' => $value ), $nondefaults, $value == $options['limit'] ); } - $cl = $this->getLang()->pipeList( $cl ); + $cl = $this->getLanguage()->pipeList( $cl ); // day links, reset 'from' to none foreach( $wgRCLinkDays as $value ) { - $dl[] = $this->makeOptionsLink( $this->getLang()->formatNum( $value ), + $dl[] = $this->makeOptionsLink( $this->getLanguage()->formatNum( $value ), array( 'days' => $value, 'from' => '' ), $nondefaults, $value == $options['days'] ); } - $dl = $this->getLang()->pipeList( $dl ); + $dl = $this->getLanguage()->pipeList( $dl ); // show/hide links @@ -830,13 +830,13 @@ class SpecialRecentChanges extends IncludableSpecialPage { // show from this onward link $timestamp = wfTimestampNow(); - $now = $this->getLang()->timeanddate( $timestamp, true ); + $now = $this->getLanguage()->timeanddate( $timestamp, true ); $tl = $this->makeOptionsLink( $now, array( 'from' => $timestamp ), $nondefaults ); $rclinks = wfMsgExt( 'rclinks', array( 'parseinline', 'replaceafter' ), - $cl, $dl, $this->getLang()->pipeList( $links ) ); + $cl, $dl, $this->getLanguage()->pipeList( $links ) ); $rclistfrom = wfMsgExt( 'rclistfrom', array( 'parseinline', 'replaceafter' ), $tl ); return "{$note}$rclinks
      $rclistfrom"; } diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index 9f15fc2292..dce79d3f38 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -245,7 +245,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { } } # Logs themselves don't have histories or archived revisions - $this->getOutput()->addSubtitle( $this->getLang()->pipeList( $links ) ); + $this->getOutput()->addSubtitle( $this->getLanguage()->pipeList( $links ) ); } } @@ -286,8 +286,8 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { if ( !$this->getUser()->matchEditToken( $this->token, $archiveName ) ) { $this->getOutput()->addWikiMsg( 'revdelete-show-file-confirm', $this->targetObj->getText(), - $this->getLang()->date( $oimage->getTimestamp() ), - $this->getLang()->time( $oimage->getTimestamp() ) ); + $this->getLanguage()->date( $oimage->getTimestamp() ), + $this->getLanguage()->time( $oimage->getTimestamp() ) ); $this->getOutput()->addHTML( Xml::openElement( 'form', array( 'method' => 'POST', @@ -335,7 +335,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $UserAllowed = true; if ( $this->typeName == 'logging' ) { - $this->getOutput()->addWikiMsg( 'logdelete-selected', $this->getLang()->formatNum( count($this->ids) ) ); + $this->getOutput()->addWikiMsg( 'logdelete-selected', $this->getLanguage()->formatNum( count($this->ids) ) ); } else { $this->getOutput()->addWikiMsg( 'revdelete-selected', $this->targetObj->getPrefixedText(), count( $this->ids ) ); diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index d517258e2e..022744f0a9 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -344,7 +344,7 @@ class SpecialSearch extends SpecialPage { if( $num || $this->offset ) { // Show the create link ahead $this->showCreateLink( $t ); - $prevnext = $this->getLang()->viewPrevNext( $this->getTitle(), $this->offset, $this->limit, + $prevnext = $this->getLanguage()->viewPrevNext( $this->getTitle(), $this->offset, $this->limit, $this->powerSearchOptions() + array( 'search' => $term ), max( $titleMatchesNum, $textMatchesNum ) < $this->limit ); @@ -600,7 +600,7 @@ class SpecialSearch extends SpecialPage { // format text extract $extract = "
      ".$result->getTextSnippet($terms)."
      "; - $lang = $this->getLang(); + $lang = $this->getLanguage(); // format score if( is_null( $result->getScore() ) ) { @@ -1001,7 +1001,7 @@ class SpecialSearch extends SpecialPage { } $profiles = $this->getSearchProfiles(); - $lang = $this->getLang(); + $lang = $this->getLanguage(); // Outputs XML for Search Types $out .= Xml::openElement( 'div', array( 'class' => 'search-types' ) ); diff --git a/includes/specials/SpecialShortpages.php b/includes/specials/SpecialShortpages.php index 1e84e45e19..9bc1bc4a40 100644 --- a/includes/specials/SpecialShortpages.php +++ b/includes/specials/SpecialShortpages.php @@ -78,7 +78,7 @@ class ShortPagesPage extends QueryPage { } function formatResult( $skin, $result ) { - $dm = $this->getLang()->getDirMark(); + $dm = $this->getLanguage()->getDirMark(); $title = Title::makeTitle( $result->namespace, $result->title ); if ( !$title ) { diff --git a/includes/specials/SpecialStatistics.php b/includes/specials/SpecialStatistics.php index 307725ff9d..b9c092b620 100644 --- a/includes/specials/SpecialStatistics.php +++ b/includes/specials/SpecialStatistics.php @@ -140,15 +140,15 @@ class SpecialStatistics extends SpecialPage { Xml::closeElement( 'tr' ) . $this->formatRow( Linker::linkKnown( SpecialPage::getTitleFor( 'Allpages' ), wfMsgExt( 'statistics-articles', array( 'parseinline' ) ) ), - $this->getLang()->formatNum( $this->good ), + $this->getLanguage()->formatNum( $this->good ), array( 'class' => 'mw-statistics-articles' ) ) . $this->formatRow( wfMsgExt( 'statistics-pages', array( 'parseinline' ) ), - $this->getLang()->formatNum( $this->total ), + $this->getLanguage()->formatNum( $this->total ), array( 'class' => 'mw-statistics-pages' ), 'statistics-pages-desc' ) . $this->formatRow( Linker::linkKnown( SpecialPage::getTitleFor( 'Listfiles' ), wfMsgExt( 'statistics-files', array( 'parseinline' ) ) ), - $this->getLang()->formatNum( $this->images ), + $this->getLanguage()->formatNum( $this->images ), array( 'class' => 'mw-statistics-files' ) ); } private function getEditStats() { @@ -156,10 +156,10 @@ class SpecialStatistics extends SpecialPage { Xml::tags( 'th', array( 'colspan' => '2' ), wfMsgExt( 'statistics-header-edits', array( 'parseinline' ) ) ) . Xml::closeElement( 'tr' ) . $this->formatRow( wfMsgExt( 'statistics-edits', array( 'parseinline' ) ), - $this->getLang()->formatNum( $this->edits ), + $this->getLanguage()->formatNum( $this->edits ), array( 'class' => 'mw-statistics-edits' ) ) . $this->formatRow( wfMsgExt( 'statistics-edits-average', array( 'parseinline' ) ), - $this->getLang()->formatNum( sprintf( '%.2f', $this->total ? $this->edits / $this->total : 0 ) ), + $this->getLanguage()->formatNum( sprintf( '%.2f', $this->total ? $this->edits / $this->total : 0 ) ), array( 'class' => 'mw-statistics-edits-average' ) ); } @@ -169,17 +169,17 @@ class SpecialStatistics extends SpecialPage { Xml::tags( 'th', array( 'colspan' => '2' ), wfMsgExt( 'statistics-header-users', array( 'parseinline' ) ) ) . Xml::closeElement( 'tr' ) . $this->formatRow( wfMsgExt( 'statistics-users', array( 'parseinline' ) ), - $this->getLang()->formatNum( $this->users ), + $this->getLanguage()->formatNum( $this->users ), array( 'class' => 'mw-statistics-users' ) ) . $this->formatRow( wfMsgExt( 'statistics-users-active', array( 'parseinline' ) ) . ' ' . Linker::linkKnown( SpecialPage::getTitleFor( 'Activeusers' ), wfMsgHtml( 'listgrouprights-members' ) ), - $this->getLang()->formatNum( $this->activeUsers ), + $this->getLanguage()->formatNum( $this->activeUsers ), array( 'class' => 'mw-statistics-users-active' ), 'statistics-users-active-desc', - $this->getLang()->formatNum( $wgActiveUserDays ) ); + $this->getLanguage()->formatNum( $wgActiveUserDays ) ); } private function getGroupStats() { @@ -221,7 +221,7 @@ class SpecialStatistics extends SpecialPage { $classZero = ' statistics-group-zero'; } $text .= $this->formatRow( $grouppage . ' ' . $grouplink, - $this->getLang()->formatNum( $countUsers ), + $this->getLanguage()->formatNum( $countUsers ), array( 'class' => 'statistics-group-' . Sanitizer::escapeClass( $group ) . $classZero ) ); } return $text; @@ -232,10 +232,10 @@ class SpecialStatistics extends SpecialPage { Xml::tags( 'th', array( 'colspan' => '2' ), wfMsgExt( 'statistics-header-views', array( 'parseinline' ) ) ) . Xml::closeElement( 'tr' ) . $this->formatRow( wfMsgExt( 'statistics-views-total', array( 'parseinline' ) ), - $this->getLang()->formatNum( $this->views ), + $this->getLanguage()->formatNum( $this->views ), array ( 'class' => 'mw-statistics-views-total' ), 'statistics-views-total-desc' ) . $this->formatRow( wfMsgExt( 'statistics-views-peredit', array( 'parseinline' ) ), - $this->getLang()->formatNum( sprintf( '%.2f', $this->edits ? + $this->getLanguage()->formatNum( sprintf( '%.2f', $this->edits ? $this->views / $this->edits : 0 ) ), array ( 'class' => 'mw-statistics-views-peredit' ) ); } @@ -268,7 +268,7 @@ class SpecialStatistics extends SpecialPage { $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title ); if( $title instanceof Title ) { $text .= $this->formatRow( Linker::link( $title ), - $this->getLang()->formatNum( $row->page_counter ) ); + $this->getLanguage()->formatNum( $row->page_counter ) ); } } @@ -289,7 +289,7 @@ class SpecialStatistics extends SpecialPage { $name = htmlspecialchars( $name ); $number = htmlspecialchars( $number ); - $return .= $this->formatRow( $name, $this->getLang()->formatNum( $number ), array( 'class' => 'mw-statistics-hook' ) ); + $return .= $this->formatRow( $name, $this->getLanguage()->formatNum( $number ), array( 'class' => 'mw-statistics-hook' ) ); } return $return; diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php index d6011d2907..adfc74412b 100644 --- a/includes/specials/SpecialTags.php +++ b/includes/specials/SpecialTags.php @@ -83,7 +83,7 @@ class SpecialTags extends SpecialPage { $desc .= ' (' . Linker::link( Title::makeTitle( NS_MEDIAWIKI, "Tag-$tag-description" ), wfMsgHtml( 'tags-edit' ) ) . ')'; $newRow .= Xml::tags( 'td', null, $desc ); - $hitcount = wfMsgExt( 'tags-hitcount', array( 'parsemag' ), $this->getLang()->formatNum( $hitcount ) ); + $hitcount = wfMsgExt( 'tags-hitcount', array( 'parsemag' ), $this->getLanguage()->formatNum( $hitcount ) ); $hitcount = Linker::link( SpecialPage::getTitleFor( 'Recentchanges' ), $hitcount, array(), array( 'tagfilter' => $tag ) ); $newRow .= Xml::tags( 'td', null, $hitcount ); diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index bc6cdfd1f0..f58aa1d82b 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -738,7 +738,7 @@ class SpecialUndelete extends SpecialPage { return; } - $out->addWikiMsg( 'undeletepagetext', $this->getLang()->formatNum( $result->numRows() ) ); + $out->addWikiMsg( 'undeletepagetext', $this->getLanguage()->formatNum( $result->numRows() ) ); $undelete = $this->getTitle(); $out->addHTML( "
        \n" ); @@ -752,7 +752,7 @@ class SpecialUndelete extends SpecialPage { ); $revs = wfMsgExt( 'undeleterevisions', array( 'parseinline' ), - $this->getLang()->formatNum( $row->count ) ); + $this->getLanguage()->formatNum( $row->count ) ); $out->addHTML( "
      • {$link} ({$revs})
      • \n" ); } $result->free(); @@ -810,9 +810,9 @@ class SpecialUndelete extends SpecialPage { // date and time are separate parameters to facilitate localisation. // $time is kept for backward compat reasons. - $time = $this->getLang()->timeAndDate( $timestamp, true ); - $d = $this->getLang()->date( $timestamp, true ); - $t = $this->getLang()->time( $timestamp, true ); + $time = $this->getLanguage()->timeAndDate( $timestamp, true ); + $d = $this->getLanguage()->date( $timestamp, true ); + $t = $this->getLanguage()->time( $timestamp, true ); $userLink = Linker::revUserTools( $rev ); if( $this->mPreview ) { @@ -938,9 +938,9 @@ class SpecialUndelete extends SpecialPage { wfMsgExt( 'revisionasof', array( 'escape' ), - $this->getLang()->timeanddate( $rev->getTimestamp(), true ), - $this->getLang()->date( $rev->getTimestamp(), true ), - $this->getLang()->time( $rev->getTimestamp(), true ) + $this->getLanguage()->timeanddate( $rev->getTimestamp(), true ), + $this->getLanguage()->date( $rev->getTimestamp(), true ), + $this->getLanguage()->time( $rev->getTimestamp(), true ) ), array(), $targetQuery @@ -961,8 +961,8 @@ class SpecialUndelete extends SpecialPage { $file = new ArchivedFile( $this->mTargetObj, '', $this->mFilename ); $this->getOutput()->addWikiMsg( 'undelete-show-file-confirm', $this->mTargetObj->getText(), - $this->getLang()->date( $file->getTimestamp() ), - $this->getLang()->time( $file->getTimestamp() ) ); + $this->getLanguage()->date( $file->getTimestamp() ), + $this->getLanguage()->time( $file->getTimestamp() ) ); $this->getOutput()->addHTML( Xml::openElement( 'form', array( 'method' => 'POST', @@ -1176,7 +1176,7 @@ class SpecialUndelete extends SpecialPage { $titleObj = $this->getTitle(); # Last link if( !$rev->userCan( Revision::DELETED_TEXT, $this->getUser() ) ) { - $pageLink = htmlspecialchars( $this->getLang()->timeanddate( $ts, true ) ); + $pageLink = htmlspecialchars( $this->getLanguage()->timeanddate( $ts, true ) ); $last = wfMsgHtml( 'diff' ); } elseif( $remaining > 0 || ( $earliestLiveTime && $ts > $earliestLiveTime ) ) { $pageLink = $this->getPageLink( $rev, $titleObj, $ts ); @@ -1195,7 +1195,7 @@ class SpecialUndelete extends SpecialPage { $last = wfMsgHtml( 'diff' ); } } else { - $pageLink = htmlspecialchars( $this->getLang()->timeanddate( $ts, true ) ); + $pageLink = htmlspecialchars( $this->getLanguage()->timeanddate( $ts, true ) ); $last = wfMsgHtml( 'diff' ); } // User links @@ -1222,15 +1222,15 @@ class SpecialUndelete extends SpecialPage { $pageLink = $this->getFileLink( $file, $this->getTitle(), $ts, $key ); } else { $checkBox = ''; - $pageLink = $this->getLang()->timeanddate( $ts, true ); + $pageLink = $this->getLanguage()->timeanddate( $ts, true ); } $userLink = $this->getFileUser( $file ); $data = wfMsg( 'widthheight', - $this->getLang()->formatNum( $row->fa_width ), - $this->getLang()->formatNum( $row->fa_height ) ) . + $this->getLanguage()->formatNum( $row->fa_width ), + $this->getLanguage()->formatNum( $row->fa_height ) ) . ' (' . - wfMsg( 'nbytes', $this->getLang()->formatNum( $row->fa_size ) ) . + wfMsg( 'nbytes', $this->getLanguage()->formatNum( $row->fa_size ) ) . ')'; $data = htmlspecialchars( $data ); $comment = $this->getFileComment( $file ); @@ -1264,7 +1264,7 @@ class SpecialUndelete extends SpecialPage { * @return string */ function getPageLink( $rev, $titleObj, $ts ) { - $time = htmlspecialchars( $this->getLang()->timeanddate( $ts, true ) ); + $time = htmlspecialchars( $this->getLanguage()->timeanddate( $ts, true ) ); if( !$rev->userCan( Revision::DELETED_TEXT, $this->getUser() ) ) { return '' . $time . ''; @@ -1293,11 +1293,11 @@ class SpecialUndelete extends SpecialPage { */ function getFileLink( $file, $titleObj, $ts, $key ) { if( !$file->userCan( File::DELETED_FILE, $this->getUser() ) ) { - return '' . $this->getLang()->timeanddate( $ts, true ) . ''; + return '' . $this->getLanguage()->timeanddate( $ts, true ) . ''; } else { $link = Linker::linkKnown( $titleObj, - $this->getLang()->timeanddate( $ts, true ), + $this->getLanguage()->timeanddate( $ts, true ), array(), array( 'target' => $this->mTargetObj->getPrefixedText(), diff --git a/includes/specials/SpecialUnusedtemplates.php b/includes/specials/SpecialUnusedtemplates.php index de6f6c7385..e5c55b8341 100644 --- a/includes/specials/SpecialUnusedtemplates.php +++ b/includes/specials/SpecialUnusedtemplates.php @@ -73,7 +73,7 @@ class UnusedtemplatesPage extends QueryPage { array(), array( 'target' => $title->getPrefixedText() ) ); - return $this->getLang()->specialList( $pageLink, $wlhLink ); + return $this->getLanguage()->specialList( $pageLink, $wlhLink ); } function getPageHeader() { diff --git a/includes/specials/SpecialUnwatchedpages.php b/includes/specials/SpecialUnwatchedpages.php index 9754b750e7..22c648585f 100644 --- a/includes/specials/SpecialUnwatchedpages.php +++ b/includes/specials/SpecialUnwatchedpages.php @@ -83,6 +83,6 @@ class UnwatchedpagesPage extends QueryPage { array( 'action' => 'watch', 'token' => $token ) ); - return $this->getLang()->specialList( $plink, $wlink ); + return $this->getLanguage()->specialList( $plink, $wlink ); } } diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 2331314487..3cb368c732 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -569,11 +569,11 @@ class SpecialUpload extends SpecialPage { case UploadBase::FILETYPE_BADTYPE: $msg = wfMessage( 'filetype-banned-type' ); if ( isset( $details['blacklistedExt'] ) ) { - $msg->params( $this->getLang()->commaList( $details['blacklistedExt'] ) ); + $msg->params( $this->getLanguage()->commaList( $details['blacklistedExt'] ) ); } else { $msg->params( $details['finalExt'] ); } - $msg->params( $this->getLang()->commaList( $wgFileExtensions ), + $msg->params( $this->getLanguage()->commaList( $wgFileExtensions ), count( $wgFileExtensions ) ); // Add PLURAL support for the first parameter. This results @@ -844,7 +844,7 @@ class UploadForm extends HTMLForm { 'radio' => &$radio, 'help' => wfMsgExt( 'upload-maxfilesize', array( 'parseinline', 'escapenoentities' ), - $this->getContext()->getLang()->formatSize( $this->mMaxUploadSize['file'] ) + $this->getContext()->getLanguage()->formatSize( $this->mMaxUploadSize['file'] ) ) . ' ' . wfMsgHtml( 'upload_source_file' ), 'checked' => $selectedSourceType == 'file', ); @@ -859,7 +859,7 @@ class UploadForm extends HTMLForm { 'radio' => &$radio, 'help' => wfMsgExt( 'upload-maxfilesize', array( 'parseinline', 'escapenoentities' ), - $this->getContext()->getLang()->formatSize( $this->mMaxUploadSize['url'] ) + $this->getContext()->getLanguage()->formatSize( $this->mMaxUploadSize['url'] ) ) . ' ' . wfMsgHtml( 'upload_source_url' ), 'checked' => $selectedSourceType == 'url', ); @@ -891,16 +891,16 @@ class UploadForm extends HTMLForm { # Everything not permitted is banned $extensionsList = '
        ' . - wfMsgExt( 'upload-permitted', 'parse', $this->getContext()->getLang()->commaList( $wgFileExtensions ) ) . + wfMsgExt( 'upload-permitted', 'parse', $this->getContext()->getLanguage()->commaList( $wgFileExtensions ) ) . "
        \n"; } else { # We have to list both preferred and prohibited $extensionsList = '
        ' . - wfMsgExt( 'upload-preferred', 'parse', $this->getContext()->getLang()->commaList( $wgFileExtensions ) ) . + wfMsgExt( 'upload-preferred', 'parse', $this->getContext()->getLanguage()->commaList( $wgFileExtensions ) ) . "
        \n" . '
        ' . - wfMsgExt( 'upload-prohibited', 'parse', $this->getContext()->getLang()->commaList( $wgFileBlacklist ) ) . + wfMsgExt( 'upload-prohibited', 'parse', $this->getContext()->getLanguage()->commaList( $wgFileBlacklist ) ) . "
        \n"; } } else { diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 2255fc1def..ed5133289e 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -1232,7 +1232,7 @@ class LoginForm extends SpecialPage { } } return count( $links ) > 0 ? $this->msg( 'loginlanguagelabel' )->rawParams( - $this->getLang()->pipeList( $links ) )->escaped() : ''; + $this->getLanguage()->pipeList( $links ) )->escaped() : ''; } else { return ''; } diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index 9f5f922d88..100d5c116d 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -421,12 +421,12 @@ class UserrightsPage extends SpecialPage { $count = count( $list ); if( $count > 0 ) { $grouplist = wfMessage( 'userrights-groupsmember', $count)->parse(); - $grouplist = '

        ' . $grouplist . ' ' . $this->getLang()->listToText( $list ) . "

        \n"; + $grouplist = '

        ' . $grouplist . ' ' . $this->getLanguage()->listToText( $list ) . "

        \n"; } $count = count( $autolist ); if( $count > 0 ) { $autogrouplistintro = wfMessage( 'userrights-groupsmember-auto', $count)->parse(); - $grouplist .= '

        ' . $autogrouplistintro . ' ' . $this->getLang()->listToText( $autolist ) . "

        \n"; + $grouplist .= '

        ' . $autogrouplistintro . ' ' . $this->getLanguage()->listToText( $autolist ) . "

        \n"; } $userToolLinks = Linker::userToolLinks( diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 4a2b8fb87f..bb17772067 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -362,7 +362,7 @@ class SpecialVersion extends SpecialPage { if( $a['name'] === $b['name'] ) { return 0; } else { - return $this->getLang()->lc( $a['name'] ) > $this->getLang()->lc( $b['name'] ) + return $this->getLanguage()->lc( $a['name'] ) > $this->getLanguage()->lc( $b['name'] ) ? 1 : -1; } @@ -546,7 +546,7 @@ class SpecialVersion extends SpecialPage { if ( $sort ) { sort( $list ); } - return $this->getLang()->listToText( array_map( array( __CLASS__, 'arrayToString' ), $list ) ); + return $this->getLanguage()->listToText( array_map( array( __CLASS__, 'arrayToString' ), $list ) ); } } diff --git a/includes/specials/SpecialWantedcategories.php b/includes/specials/SpecialWantedcategories.php index 212bd5b3f3..33e789dedd 100644 --- a/includes/specials/SpecialWantedcategories.php +++ b/includes/specials/SpecialWantedcategories.php @@ -69,7 +69,7 @@ class WantedCategoriesPage extends WantedQueryPage { array( 'broken' ) ); - $lang = $this->getLang(); + $lang = $this->getLanguage(); $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape' ), $lang->formatNum( $result->value ) ); return $lang->specialList( $plink, $nlinks ); diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 3e4bdd9a3f..94ab6b58e9 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -240,7 +240,7 @@ class SpecialWatchlist extends SpecialPage { $output->showLagWarning( $lag ); } - $lang = $this->getLang(); + $lang = $this->getLanguage(); # Create output form $form = Xml::fieldset( wfMsg( 'watchlist-options' ), false, array( 'id' => 'mw-watchlist-options' ) ); @@ -419,7 +419,7 @@ class SpecialWatchlist extends SpecialPage { return Linker::linkKnown( $this->getTitle(), - $this->getLang()->formatNum( $h ), + $this->getLanguage()->formatNum( $h ), array(), $options ); @@ -427,7 +427,7 @@ class SpecialWatchlist extends SpecialPage { protected function daysLink( $d, $options = array() ) { $options['days'] = $d; - $message = ( $d ? $this->getLang()->formatNum( $d ) : wfMsgHtml( 'watchlistall2' ) ); + $message = ( $d ? $this->getLanguage()->formatNum( $d ) : wfMsgHtml( 'watchlistall2' ) ); return Linker::linkKnown( $this->getTitle(), @@ -455,8 +455,8 @@ class SpecialWatchlist extends SpecialPage { } return wfMsgExt('wlshowlast', array('parseinline', 'replaceafter'), - $this->getLang()->pipeList( $hours ), - $this->getLang()->pipeList( $days ), + $this->getLanguage()->pipeList( $hours ), + $this->getLanguage()->pipeList( $days ), $this->daysLink( 0, $options ) ); } diff --git a/includes/specials/SpecialWhatlinkshere.php b/includes/specials/SpecialWhatlinkshere.php index 82ad7dfb1a..e55374e677 100644 --- a/includes/specials/SpecialWhatlinkshere.php +++ b/includes/specials/SpecialWhatlinkshere.php @@ -278,7 +278,7 @@ class SpecialWhatLinksHere extends SpecialPage { } protected function listItem( $row, $nt, $notClose = false ) { - $dirmark = $this->getLang()->getDirMark(); + $dirmark = $this->getLanguage()->getDirMark(); # local message cache static $msgcache = null; @@ -371,7 +371,7 @@ class SpecialWhatLinksHere extends SpecialPage { } $limitLinks = array(); - $lang = $this->getLang(); + $lang = $this->getLanguage(); foreach ( $this->limits as $limit ) { $prettyLimit = htmlspecialchars( $lang->formatNum( $limit ) ); $overrides = array( 'limit' => $limit ); @@ -451,6 +451,6 @@ class SpecialWhatLinksHere extends SpecialPage { $overrides = array( $type => !$chosen ); $links[] = wfMsgHtml( "whatlinkshere-{$type}", $this->makeSelfLink( $msg, array_merge( $changed, $overrides ) ) ); } - return Xml::fieldset( wfMsg( 'whatlinkshere-filters' ), $this->getLang()->pipeList( $links ) ); + return Xml::fieldset( wfMsg( 'whatlinkshere-filters' ), $this->getLanguage()->pipeList( $links ) ); } } diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 4b6fbe1ac6..37fdab1cca 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -112,7 +112,7 @@ class CologneBlueTemplate extends LegacyTemplate { $s .= ''; $s .= $this->bottomLinks(); - $s .= $this->getSkin()->getLang()->pipeList( array( + $s .= $this->getSkin()->getLanguage()->pipeList( array( "\n
        " . Linker::link( Title::newMainPage(), null, @@ -189,7 +189,7 @@ class CologneBlueTemplate extends LegacyTemplate { ); } - return $this->getSkin()->getLang()->pipeList( $s ); + return $this->getSkin()->getLanguage()->pipeList( $s ); } /** diff --git a/skins/Standard.php b/skins/Standard.php index 7db8a68a17..bd0c41a5c0 100644 --- a/skins/Standard.php +++ b/skins/Standard.php @@ -66,11 +66,11 @@ class StandardTemplate extends LegacyTemplate { wfProfileOut( __METHOD__ . '-1' ); wfProfileIn( __METHOD__ . '-2' ); - $l = $this->getSkin()->getLang()->alignStart(); + $l = $this->getSkin()->getLanguage()->alignStart(); $s .= ""; $s .= $this->bottomLinks(); - $s .= "\n
        " . $this->getSkin()->getLang()->pipeList( array( + $s .= "\n
        " . $this->getSkin()->getLanguage()->pipeList( array( $this->getSkin()->mainPageLink(), $this->getSkin()->aboutLink(), Linker::specialLink( 'Recentchanges' ), diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index bce481becc..d9acf6a2ab 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -182,7 +182,7 @@ class ParserTest { // $wgContLang = new StubContLang; $wgUser = new User; $context = new RequestContext; - $wgLang = $context->getLang(); + $wgLang = $context->getLanguage(); $wgOut = $context->getOutput(); $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) ); $wgRequest = $context->getRequest(); @@ -695,7 +695,7 @@ class ParserTest { $GLOBALS['wgMemc'] = new EmptyBagOStuff; $context = new RequestContext(); - $GLOBALS['wgLang'] = $context->getLang(); + $GLOBALS['wgLang'] = $context->getLanguage(); $GLOBALS['wgOut'] = $context->getOutput(); $GLOBALS['wgUser'] = new User(); diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index b255bf0079..37a0486fb7 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -79,7 +79,7 @@ class NewParserTest extends MediaWikiTestCase { // $tmpGlobals['wgContLang'] = new StubContLang; $tmpGlobals['wgUser'] = new User; $context = new RequestContext(); - $tmpGlobals['wgLang'] = $context->getLang(); + $tmpGlobals['wgLang'] = $context->getLanguage(); $tmpGlobals['wgOut'] = $context->getOutput(); $tmpGlobals['wgParser'] = new StubObject( 'wgParser', $GLOBALS['wgParserConf']['class'], array( $GLOBALS['wgParserConf'] ) ); $tmpGlobals['wgRequest'] = $context->getRequest(); @@ -309,7 +309,7 @@ class NewParserTest extends MediaWikiTestCase { $langObj = Language::factory( $lang ); $GLOBALS['wgContLang'] = $langObj; $context = new RequestContext(); - $GLOBALS['wgLang'] = $context->getLang(); + $GLOBALS['wgLang'] = $context->getLanguage(); $GLOBALS['wgMemc'] = new EmptyBagOStuff; $GLOBALS['wgOut'] = $context->getOutput(); diff --git a/tests/phpunit/suites/UploadFromUrlTestSuite.php b/tests/phpunit/suites/UploadFromUrlTestSuite.php index f6f2fbdb85..c9f413eda8 100644 --- a/tests/phpunit/suites/UploadFromUrlTestSuite.php +++ b/tests/phpunit/suites/UploadFromUrlTestSuite.php @@ -49,7 +49,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite { // $wgContLang = new StubContLang; $wgUser = new User; $context = new RequestContext; - $wgLang = $context->getLang(); + $wgLang = $context->getLanguage(); $wgOut = $context->getOutput(); $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) ); $wgRequest = $context->getRequest(); -- 2.20.1