r90517 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90516‎ | r90517 | r90518 >
Date:10:14, 21 June 2011
Author:robin
Status:resolved (Comments)
Tags:
Comment:
* Improvements as part of bug 6100: Use wfUILang() instead of $wgContLang where appropriate
* Remove $wgContLang in SpecialVersion per r90302
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialBrokenRedirects.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialDisambiguations.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialDoubleRedirects.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialListredirects.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialNewpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialProtectedpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialShortpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -2522,8 +2522,7 @@
25232523 }
25242524
25252525 function wfSpecialList( $page, $details ) {
2526 - global $wgContLang;
2527 - $details = $details ? ' ' . $wgContLang->getDirMark() . "($details)" : '';
 2526+ $details = $details ? ' ' . wfUILang()->getDirMark() . "($details)" : '';
25282527 return $page . $details;
25292528 }
25302529
Index: trunk/phase3/includes/specials/SpecialProtectedpages.php
@@ -76,7 +76,7 @@
7777 * @return string Formatted <li> element
7878 */
7979 public function formatRow( $row ) {
80 - global $wgUser, $wgLang, $wgContLang;
 80+ global $wgUser, $wgLang;
8181
8282 wfProfileIn( __METHOD__ );
8383
@@ -116,7 +116,7 @@
117117 }
118118
119119 if(!is_null($size = $row->page_len)) {
120 - $stxt = $wgContLang->getDirMark() . ' ' . $skin->formatRevisionSize( $size );
 120+ $stxt = wfUILang()->getDirMark() . ' ' . $skin->formatRevisionSize( $size );
121121 }
122122
123123 # Show a link to the change protection form for allowed users otherwise a link to the protection log
Index: trunk/phase3/includes/specials/SpecialDoubleRedirects.php
@@ -76,8 +76,6 @@
7777 }
7878
7979 function formatResult( $skin, $result ) {
80 - global $wgContLang;
81 -
8280 $titleA = Title::makeTitle( $result->namespace, $result->title );
8381
8482 if ( $result && !isset( $result->nsb ) ) {
@@ -119,7 +117,7 @@
120118 array( 'redirect' => 'no' )
121119 );
122120 $linkC = $skin->linkKnown( $titleC );
123 - $arr = $wgContLang->getArrow() . $wgContLang->getDirMark();
 121+ $arr = wfUILang()->getArrow() . wfUILang()->getDirMark();
124122
125123 return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
126124 }
Index: trunk/phase3/includes/specials/SpecialListredirects.php
@@ -96,8 +96,6 @@
9797 }
9898
9999 function formatResult( $skin, $result ) {
100 - global $wgContLang;
101 -
102100 # Make a link to the redirect itself
103101 $rd_title = Title::makeTitle( $result->namespace, $result->title );
104102 $rd_link = $skin->link(
@@ -111,7 +109,7 @@
112110 $target = $this->getRedirectTarget( $result );
113111 if( $target ) {
114112 # Make a link to the destination page
115 - $arr = $wgContLang->getArrow() . $wgContLang->getDirMark();
 113+ $arr = wfUILang()->getArrow() . wfUILang()->getDirMark();
116114 $targetLink = $skin->link( $target );
117115 return "$rd_link $arr $targetLink";
118116 } else {
Index: trunk/phase3/includes/specials/SpecialNewpages.php
@@ -289,7 +289,7 @@
290290 * @return String
291291 */
292292 public function formatRow( $result ) {
293 - global $wgLang, $wgContLang;
 293+ global $wgLang;
294294
295295 # Revision deletion works on revisions, so we should cast one
296296 $row = array(
@@ -302,7 +302,7 @@
303303
304304 $classes = array();
305305
306 - $dm = $wgContLang->getDirMark();
 306+ $dm = wfUILang()->getDirMark();
307307
308308 $title = Title::makeTitleSafe( $result->rc_namespace, $result->rc_title );
309309 $time = Html::element( 'span', array( 'class' => 'mw-newpages-time' ),
Index: trunk/phase3/includes/specials/SpecialDisambiguations.php
@@ -122,14 +122,13 @@
123123 }
124124
125125 function formatResult( $skin, $result ) {
126 - global $wgContLang;
127126 $title = Title::newFromID( $result->value );
128127 $dp = Title::makeTitle( $result->namespace, $result->title );
129128
130129 $from = $skin->link( $title );
131130 $edit = $skin->link( $title, wfMsgExt( 'parentheses', array( 'escape' ), wfMsg( 'editlink' ) ) ,
132131 array(), array( 'redirect' => 'no', 'action' => 'edit' ) );
133 - $arr = $wgContLang->getArrow();
 132+ $arr = wfUILang()->getArrow();
134133 $to = $skin->link( $dp );
135134
136135 return "$from $edit $arr $to";
Index: trunk/phase3/includes/specials/SpecialBrokenRedirects.php
@@ -77,7 +77,7 @@
7878 * @return String
7979 */
8080 function formatResult( $skin, $result ) {
81 - global $wgUser, $wgContLang, $wgLang;
 81+ global $wgUser, $wgLang;
8282
8383 $fromObj = Title::makeTitle( $result->namespace, $result->title );
8484 if ( isset( $result->rd_title ) ) {
@@ -116,7 +116,7 @@
117117 array(),
118118 array( 'broken' )
119119 );
120 - $arr = $wgContLang->getArrow();
 120+ $arr = wfUILang()->getArrow();
121121
122122 $out = $from . wfMsg( 'word-separator' );
123123
Index: trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php
@@ -91,7 +91,7 @@
9292 }
9393
9494 function execute( $par ) {
95 - global $wgRequest, $wgOut, $wgLang, $wgContLang, $wgScript;
 95+ global $wgRequest, $wgOut, $wgLang, $wgScript;
9696
9797 $this->setHeaders();
9898 $this->outputHeader();
@@ -126,7 +126,7 @@
127127 }
128128
129129 if( $this->hash != '' ) {
130 - $align = $wgContLang->alignEnd();
 130+ $align = wfUILang()->alignEnd();
131131
132132 # Show a thumbnail of the file
133133 $img = $this->file;
Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -543,7 +543,7 @@
544544 * @todo This would probably look a lot nicer in a table.
545545 */
546546 function formatRow( $row ) {
547 - global $wgUser, $wgLang, $wgContLang;
 547+ global $wgUser, $wgLang;
548548 wfProfileIn( __METHOD__ );
549549
550550 $sk = $this->getSkin();
@@ -590,7 +590,7 @@
591591 array( 'action' => 'history' )
592592 );
593593
594 - $comment = $wgContLang->getDirMark() . $sk->revComment( $rev, false, true );
 594+ $comment = wfUILang()->getDirMark() . $sk->revComment( $rev, false, true );
595595 $date = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
596596 if( $rev->userCan( Revision::DELETED_TEXT ) ) {
597597 $d = $sk->linkKnown(
Index: trunk/phase3/includes/specials/SpecialShortpages.php
@@ -86,8 +86,8 @@
8787 }
8888
8989 function formatResult( $skin, $result ) {
90 - global $wgLang, $wgContLang;
91 - $dm = $wgContLang->getDirMark();
 90+ global $wgLang;
 91+ $dm = wfUILang()->getDirMark();
9292
9393 $title = Title::makeTitle( $result->namespace, $result->title );
9494 if ( !$title ) {
Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -49,7 +49,7 @@
5050 * main()
5151 */
5252 public function execute( $par ) {
53 - global $wgOut, $wgSpecialVersionShowHooks, $wgContLang, $wgRequest;
 53+ global $wgOut, $wgSpecialVersionShowHooks, $wgRequest;
5454
5555 $this->setHeaders();
5656 $this->outputHeader();
Index: trunk/phase3/includes/LogEventsList.php
@@ -364,12 +364,11 @@
365365 }
366366
367367 private function logComment( $row ) {
368 - global $wgContLang;
369368 if( self::isDeleted( $row, LogPage::DELETED_COMMENT ) ) {
370369 $comment = '<span class="history-deleted">' .
371370 wfMsgHtml( 'rev-deleted-comment' ) . '</span>';
372371 } else {
373 - $comment = $wgContLang->getDirMark() .
 372+ $comment = wfUILang()->getDirMark() .
374373 $this->skin->commentBlock( $row->log_comment );
375374 }
376375 return $comment;

Follow-up revisions

RevisionCommit summaryAuthorDate
r90581Directionality improvements as part of bug 6100 (under $wgBetterDirectionalit...robin13:10, 22 June 2011
r90734(bug 12406) Pages with names in RTL scripts are not listed correctly in Speci...robin20:25, 24 June 2011
r90742Directionality and language improvements as part of bug 6100 (under $wgBetter...robin22:10, 24 June 2011
r90743Directionality improvements as part of bug 6100 (under $wgBetterDirectionality):...robin23:01, 24 June 2011
r91315* Add release notes for my recent commits (bug 6100 and others like bugs 2803...robin22:50, 1 July 2011
r91518(bug 6100; follow-up to r91315) Being bold and removing $wgBetterDirectionali...robin02:26, 6 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r14495* (bug 6100) BiDi: different directionality for user interface and wiki conte...nikerabbit15:19, 31 May 2006
r44000(bug 6100) Strip Unicode BiDi embedding/override characters (U+202A - U+202E)...vyznev20:11, 27 November 2008
r60786Make LTR wgLang do the right thing on RTL wgContLang wikis. See bug 6100 and...mah09:32, 7 January 2010
r90264(part of bug 6100) Set the directionality based on user language instead of c...robin11:32, 17 June 2011
r90302Remove unneeded div with dir on Special:Version. It used to be English-only (...robin18:11, 17 June 2011
r90320Follow-up to r90265: directionality improvements as part of bug 6100 (under $...robin21:48, 17 June 2011
r90334Follow-up to r90265: directionality improvements as part of bug 6100 (under $...robin13:12, 18 June 2011

Comments

#Comment by Nikerabbit (talk | contribs)   10:46, 17 August 2011

This has been superseded by using $wgLang directly when applicable.

Status & tagging log