r14495 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14494‎ | r14495 | r14496 >
Date:15:19, 31 May 2006
Author:nikerabbit
Status:old
Tags:
Comment:
* (bug 6100) BiDi: different directionality for user interface and wiki content (core parts of the patch)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/skins/CologneBlue.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)
  • /trunk/phase3/skins/Standard.php (modified) (history)
  • /trunk/phase3/skins/common/common_content_rtl.css (added) (history)
  • /trunk/phase3/skins/monobook/content_rtl.css (added) (history)
  • /trunk/phase3/skins/monobook/main.css (modified) (history)
  • /trunk/phase3/skins/monobook/rtl.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/monobook/content_rtl.css
@@ -0,0 +1,100 @@
 2+/*
 3+Right-to-left fixes for MonoBook.
 4+Places sidebar on right, tweaks various alignment issues.
 5+
 6+Works mostly ok nicely on Safari 1.2.1; fine in Mozilla.
 7+
 8+Safari bugs (1.2.1):
 9+* Tabs are still appearing in left-to-right order. (Try after localizing)
 10+
 11+Opera bugs (7.23 linux):
 12+* Some bits of ltr text (sidebar box titles) have forward and backward versions overlapping each other
 13+
 14+IE/mac bugs:
 15+* The thing barfs on Hebrew and Arabic anyway, so no point testing.
 16+
 17+Missing features due to lack of support:
 18+* external link icons
 19+
 20+To test:
 21+* Opera6
 22+* IE 5.0
 23+* etc
 24+
 25+*/
 26+#realContent {
 27+ direction: rtl;
 28+/* unicode-bidi: bidi-override;*/
 29+ unicode-bidi: embed;
 30+}
 31+
 32+/* Fix alignment */
 33+.documentByLine {
 34+ text-align: left;
 35+}
 36+
 37+div div.thumbcaption {
 38+ text-align: right;
 39+}
 40+
 41+div.magnify,
 42+#div.townBox {
 43+ left: auto;
 44+ right: 0;
 45+}
 46+
 47+/* Fix margins for non-css2 browsers */
 48+/* top right bottom left */
 49+
 50+ul {
 51+ margin-left: 0;
 52+ margin-right: 1.5em;
 53+}
 54+ol {
 55+ margin-left: 0;
 56+ margin-right: 2.4em;
 57+}
 58+dd {
 59+ margin-left: 0;
 60+ margin-right: 1.6em;
 61+}
 62+/* ??? */
 63+li {
 64+ margin-left: 0;
 65+ margin-right: 2.4em;
 66+}
 67+.tocindent {
 68+ margin-left: 0;
 69+ margin-right: 2em;
 70+}
 71+div.tright, div.floatright, table.floatright {
 72+ clear: none;
 73+}
 74+div.tleft, div.floatleft, table.floatleft {
 75+ clear: left;
 76+}
 77+div.townBox {
 78+ margin-left: 0;
 79+ margin-right: 1em;
 80+}
 81+div.townBox dl dd {
 82+ margin-left: 0;
 83+ margin-right: 1.1em;
 84+}
 85+/* Fix link icons */
 86+.external {
 87+ padding: 0 !important;
 88+ background: none !important;
 89+}
 90+
 91+
 92+
 93+/* workaround for moz bug, displayed bullets on left side */
 94+
 95+#toc ul {
 96+ text-align: right;
 97+}
 98+
 99+#toc ul ul {
 100+ margin: 0 2em 0 0;
 101+}
Property changes on: trunk/phase3/skins/monobook/content_rtl.css
___________________________________________________________________
Added: svn:eol-style
1102 + native
Index: trunk/phase3/skins/monobook/rtl.css
@@ -52,19 +52,11 @@
5353 }
5454
5555 /* Fix alignment */
56 -.documentByLine,
5756 .portletDetails,
5857 .portletMore,
5958 #p-personal {
6059 text-align: left;
6160 }
62 -
63 -div div.thumbcaption {
64 - text-align: right;
65 -}
66 -
67 -div.magnify,
68 -#div.townBox,
6961 #p-logo {
7062 left: auto;
7163 right: 0;
@@ -73,7 +65,20 @@
7466 left: auto;
7567 right: 0;
7668 }
 69+#p-navigation .pBody {
 70+ padding-right: auto;
 71+}
7772
 73+/* the icon in front of the user name, single quotes
 74+in bg url to hide it from iemac */
 75+li#pt-userpage,
 76+li#pt-anonuserpage,
 77+li#pt-login {
 78+ background: url(user.gif) top right no-repeat;
 79+ padding-left: 0px;
 80+ padding-right: 20px;
 81+ text-transform: none;
 82+}
7883 #p-cactions {
7984 left: auto;
8085 right: 11.5em;
@@ -104,15 +109,15 @@
105110 /* Fix margins for non-css2 browsers */
106111 /* top right bottom left */
107112
108 -ul {
 113+.portlet ul {
109114 margin-left: 0;
110115 margin-right: 1.5em;
111116 }
112 -ol {
 117+.portlet ol {
113118 margin-left: 0;
114119 margin-right: 2.4em;
115120 }
116 -dd {
 121+.portlet dd {
117122 margin-left: 0;
118123 margin-right: 1.6em;
119124 }
@@ -120,24 +125,6 @@
121126 margin-right: 1em;
122127 margin-left: 0;
123128 }
124 -.tocindent {
125 - margin-left: 0;
126 - margin-right: 2em;
127 -}
128 -div.tright, div.floatright, table.floatright {
129 - clear: none;
130 -}
131 -div.tleft, div.floatleft, table.floatleft {
132 - clear: left;
133 -}
134 -div.townBox {
135 - margin-left: 0;
136 - margin-right: 1em;
137 -}
138 -div.townBox dl dd {
139 - margin-left: 0;
140 - margin-right: 1.1em;
141 -}
142129 #p-personal li {
143130 margin-left: 0;
144131 margin-right: 1em;
@@ -152,11 +139,6 @@
153140 #p-personal li {
154141 float: left;
155142 }
156 -/* Fix link icons */
157 -.external {
158 - padding: 0 !important;
159 - background: none !important;
160 -}
161143 #footer {
162144 clear: both;
163145 }
@@ -191,16 +173,6 @@
192174 padding-right: 2em;
193175 }
194176
195 -/* workaround for moz bug, displayed bullets on left side */
196 -
197 -#toc ul {
198 - text-align: right;
199 -}
200 -
201 -#toc ul ul {
202 - margin: 0 2em 0 0;
203 -}
204 -
205177 input#wpSave, input#wpDiff {
206178 margin-right: 0;
207179 margin-left: .33em;
Index: trunk/phase3/skins/monobook/main.css
@@ -569,7 +569,7 @@
570570 ** keep the whitespace in front of the ^=, hides rule from konqueror
571571 ** this is css3, the validator doesn't like it when validating as css2
572572 */
573 -#bodyContent a.external,
 573+#bodyContent a.external[DIR="ltr"],
574574 #bodyContent a[href ^="gopher://"] {
575575 background: url(external.png) center right no-repeat;
576576 padding-right: 13px;
@@ -676,6 +676,8 @@
677677 list-style-type: square;
678678 list-style-image: url(bullet.gif);
679679 font-size: 95%;
 680+ margin: .3em 0 0 1.5em;
 681+ padding: 0;
680682 }
681683 .portlet li {
682684 padding: 0;
@@ -718,7 +720,7 @@
719721 }
720722
721723 #p-navigation .pBody {
722 - padding-right: 0;
 724+/* padding-right: 0; */
723725 }
724726
725727 #p-navigation a {
Index: trunk/phase3/skins/CologneBlue.php
@@ -98,14 +98,15 @@
9999 }
100100
101101 function doGetUserStyles() {
102 - global $wgOut;
 102+ global $wgOut, $wgLang, $wgUser;
103103 $s = parent::doGetUserStyles();
104104 $qb = $this->qbSetting();
105105
106 - if ( 2 == $qb ) { # Right
 106+ if ( (!$wgUser->isLoggedIn() && $wgLang->isRTL() ) ||
 107+ ( 2 == $qb ) ) { # Right
107108 $s .= "#quickbar { position: absolute; right: 4px; }\n" .
108109 "#article { margin-left: 4px; margin-right: 148px; }\n";
109 - } else if ( 1 == $qb ) {
 110+ } else if ( (!$wgUser->isLoggedIn()) || ( 1 == $qb ) ) {
110111 $s .= "#quickbar { position: absolute; left: 4px; }\n" .
111112 "#article { margin-left: 148px; margin-right: 4px; }\n";
112113 } else if ( 3 == $qb ) { # Floating left
Index: trunk/phase3/skins/Standard.php
@@ -52,16 +52,18 @@
5353 *
5454 */
5555 function doGetUserStyles() {
56 - global $wgStylePath;
 56+ global $wgStylePath, $wgLang, $wgUser;
5757
5858 $s = parent::doGetUserStyles();
5959 $qb = $this->qbSetting();
6060
61 - if ( 2 == $qb ) { # Right
 61+ if ( (!$wgUser->isLoggedIn() && $wgLang->isRTL() ) ||
 62+ ( 2 == $qb ) ) { # Right
6263 $s .= "#quickbar { position: absolute; top: 4px; right: 4px; " .
6364 "border-left: 2px solid #000000; }\n" .
6465 "#article { margin-left: 4px; margin-right: 152px; }\n";
65 - } else if ( 1 == $qb || 3 == $qb ) {
 66+ } else if ( (!$wgUser->isLoggedIn()) ||
 67+ ( 1 == $qb || 3 == $qb ) ) {
6668 $s .= "#quickbar { position: absolute; top: 4px; left: 4px; " .
6769 "border-right: 1px solid gray; }\n" .
6870 "#article { margin-left: 152px; margin-right: 4px; }\n";
@@ -90,7 +92,7 @@
9193 }
9294
9395 function doAfterContent() {
94 - global $wgContLang;
 96+ global $wgLang;
9597 $fname = 'SkinStandard::doAfterContent';
9698 wfProfileIn( $fname );
9799 wfProfileIn( $fname.'-1' );
@@ -105,14 +107,14 @@
106108 $qb = $this->qbSetting();
107109 $shove = ($qb != 0);
108110 $left = ($qb == 1 || $qb == 3);
109 - if($wgContLang->isRTL()) $left = !$left;
 111+ if($wgLang->isRTL()) $left = !$left;
110112
111113 if ( $shove && $left ) { # Left
112114 $s .= $this->getQuickbarCompensator();
113115 }
114116 wfProfileOut( $fname.'-2' );
115117 wfProfileIn( $fname.'-3' );
116 - $l = $wgContLang->isRTL() ? 'right' : 'left';
 118+ $l = $wgLang->isRTL() ? 'right' : 'left';
117119 $s .= "<td class='bottom' align='$l' valign='top'>";
118120
119121 $s .= $this->bottomLinks();
Index: trunk/phase3/skins/common/common_content_rtl.css
@@ -0,0 +1 @@
 2+/* RTL specific styles for date content (not layout) go here */
Property changes on: trunk/phase3/skins/common/common_content_rtl.css
___________________________________________________________________
Added: svn:eol-style
13 + native
Index: trunk/phase3/skins/MonoBook.php
@@ -51,7 +51,7 @@
5252 wfSuppressWarnings();
5353
5454 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
55 -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
 55+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('uselang') ?>" lang="<?php $this->text('uselang') ?>" dir="<?php $this->text('dir') ?>">
5656 <head>
5757 <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
5858 <?php $this->html('headlinks') ?>
@@ -93,7 +93,7 @@
9494 <div id="content">
9595 <a name="top" id="top"></a>
9696 <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
97 - <h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?></h1>
 97+ <h1 class="firstHeading"<?php $this->text('titledir') ?>><?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?></h1>
9898 <div id="bodyContent">
9999 <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
100100 <div id="contentSub"><?php $this->html('subtitle') ?></div>
@@ -124,6 +124,9 @@
125125 <h5><?php $this->msg('personaltools') ?></h5>
126126 <div class="pBody">
127127 <ul>
 128+<?php if ($this->data['rtl'] == "1")
 129+ $this->data['personal_urls'] =
 130+ array_reverse($this->data['personal_urls'], true); ?>
128131 <?php foreach($this->data['personal_urls'] as $key => $item) { ?>
129132 <li id="pt-<?php echo htmlspecialchars($key) ?>"<?php
130133 if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php
Index: trunk/phase3/includes/Article.php
@@ -734,7 +734,7 @@
735735 * the given title.
736736 */
737737 function view() {
738 - global $wgUser, $wgOut, $wgRequest, $wgContLang;
 738+ global $wgUser, $wgOut, $wgRequest, $wgLang;
739739 global $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol, $wgParser;
740740 global $wgUseTrackbacks;
741741 $sk = $wgUser->getSkin();
@@ -891,7 +891,7 @@
892892 $wgOut->addHTML( '<pre>'.htmlspecialchars($this->mContent)."\n</pre>" );
893893 } else if ( $rt = Title::newFromRedirect( $text ) ) {
894894 # Display redirect
895 - $imageDir = $wgContLang->isRTL() ? 'rtl' : 'ltr';
 895+ $imageDir = $wgLang->isRTL() ? 'rtl' : 'ltr';
896896 $imageUrl = $wgStylePath.'/common/images/redirect' . $imageDir . '.png';
897897 # Don't overwrite the subtitle if this was an old revision
898898 if( !$wasRedirected && $this->isCurrent() ) {
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1850,6 +1850,36 @@
18511851 return $items;
18521852 }
18531853
 1854+/** @todo document */
 1855+/* returns a dir="rtl" or dir="ltr" for the layout (eg: uselang) */
 1856+function layoutdir() {
 1857+ global $wgLang, $wgLanguageCode, $wgContLang, $wgContLanguageCode;
 1858+ $lang = "";
 1859+ $dir = "";
 1860+ if ( $wgLanguageCode != $wgContLanguageCode ) {
 1861+ $lang = " lang='$wgLanguageCode'";
 1862+ }
 1863+ if ( $wgLang->isRTL() != $wgContLang->isRTL() ) {
 1864+ $dir = $wgLang->isRTL() ? " dir='rtl'" : " dir='ltr'";
 1865+ }
 1866+ return $lang . $dir;
 1867+}
 1868+
 1869+/** @todo document */
 1870+/* returns a dir="rtl" or dir="ltr" for the content (wiki lang) */
 1871+function contentdir() {
 1872+ global $wgLang, $wgLanguageCode, $wgContLang, $wgContLanguageCode;
 1873+ $lang = "";
 1874+ $dir = "";
 1875+ if ( $wgLanguageCode != $wgContLanguageCode ) {
 1876+ $lang = " lang='$wgContLanguageCode'";
 1877+ }
 1878+ if ( $wgLang->isRTL() != $wgContLang->isRTL() ) {
 1879+ $dir = $wgContLang->isRTL() ? " dir='rtl'" : " dir='ltr'";
 1880+ }
 1881+ return $lang . $dir;
 1882+}
 1883+
18541884 class ReplacerCallback {
18551885 function ReplacerCallback( $from, $to ) {
18561886 $this->from = $from;
Index: trunk/phase3/includes/EditPage.php
@@ -1313,7 +1313,10 @@
13141314 $wgOut->addParserOutputNoText( $parserOutput );
13151315
13161316 wfProfileOut( $fname );
1317 - return $previewhead . $previewHTML;
 1317+ return $previewhead .
 1318+ '<div id="realContent"' . contentdir() . '>' .
 1319+ $previewHTML .
 1320+ '</div><!-- realContent -->';
13181321 }
13191322 }
13201323
Index: trunk/phase3/includes/OutputPage.php
@@ -332,7 +332,9 @@
333333 $text = $parserOutput->getText();
334334 wfRunHooks( 'OutputPageBeforeHTML',array( &$this, &$text ) );
335335 $parserOutput->setText( $text );
 336+ $this->addHTML( '<div id="realContent"' . contentdir() . '>');
336337 $this->addHTML( $parserOutput->getText() );
 338+ $this->addHTML( '</div><!-- realContent -->');
337339 }
338340
339341 /**
@@ -385,7 +387,9 @@
386388 $this->mNewSectionLink = $parserOutput->getNewSection();
387389 $text = $parserOutput->getText();
388390 wfRunHooks( 'OutputPageBeforeHTML', array( &$this, &$text ) );
 391+ $this->addHTML( '<div id="realContent"' . contentdir() . '>');
389392 $this->addHTML( $text );
 393+ $this->addHTML( '</div><!-- realContent -->');
390394 $t = $parserOutput->getTitleText();
391395 if( !empty( $t ) ) {
392396 $this->setPageTitle( $t );
@@ -948,6 +952,7 @@
949953 function headElement() {
950954 global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType;
951955 global $wgUser, $wgContLang, $wgUseTrackbacks, $wgTitle;
 956+ global $wgLang, $wgLanguageCode;
952957
953958 if( $wgMimeType == 'text/xml' || $wgMimeType == 'application/xhtml+xml' || $wgMimeType == 'application/xml' ) {
954959 $ret = "<?xml version=\"1.0\" encoding=\"$wgOutputEncoding\" ?>\n";
@@ -961,8 +966,8 @@
962967 $this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ));
963968 }
964969
965 - $rtl = $wgContLang->isRTL() ? " dir='RTL'" : '';
966 - $ret .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"$wgContLanguageCode\" lang=\"$wgContLanguageCode\" $rtl>\n";
 970+ $rtl = $wgLang->isRTL() ? " dir='RTL'" : '';
 971+ $ret .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"$wgLanguageCode\" lang=\"$wgLanguageCode\" $rtl>\n";
967972 $ret .= "<head>\n<title>" . htmlspecialchars( $this->getHTMLTitle() ) . "</title>\n";
968973 array_push( $this->mMetatags, array( "http:Content-type", "$wgMimeType; charset={$wgOutputEncoding}" ) );
969974
Index: trunk/phase3/includes/SkinTemplate.php
@@ -134,7 +134,7 @@
135135 */
136136 function outputPage( &$out ) {
137137 global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgContLang, $wgOut;
138 - global $wgScript, $wgStylePath, $wgContLanguageCode;
 138+ global $wgScript, $wgStylePath, $wgLanguageCode, $wgContLanguageCode;
139139 global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgRequest;
140140 global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgHideInterlanguageLinks;
141141 global $wgMaxCredits, $wgShowCreditsIfMax;
@@ -247,8 +247,20 @@
248248 $tpl->setRef( 'stylepath', $wgStylePath );
249249 $tpl->setRef( 'logopath', $wgLogo );
250250 $tpl->setRef( "lang", $wgContLanguageCode );
251 - $tpl->set( 'dir', $wgContLang->isRTL() ? "rtl" : "ltr" );
252 - $tpl->set( 'rtl', $wgContLang->isRTL() );
 251+ $tpl->setRef( 'uselang', $wgLanguageCode );
 252+ $tpl->set( 'dir', $wgLang->isRTL() ? "rtl" : "ltr" );
 253+ $tpl->set( 'rtl', $wgLang->isRTL() );
 254+ /* display, if needed, dir=ltr or dir=rtl for the
 255+ firstHeading title. This is when the title is
 256+ content, eg a site-localized string;
 257+ that is the case for all the pages not in Special:
 258+ when action is view or history
 259+ */
 260+ $tpl->set( 'titledir',
 261+ ($this->mTitle->getNamespace() != NS_SPECIAL &&
 262+ ($action == 'view' || $action == 'history')) ?
 263+ contentdir() : ""
 264+ );
253265 $tpl->set( 'langname', $wgContLang->getLanguageName( $wgContLanguageCode ) );
254266 $tpl->set( 'showjumplinks', $wgUser->getOption( 'showjumplinks' ) );
255267 $tpl->setRef( 'username', $this->username );
@@ -392,7 +404,7 @@
393405 $nt = Title::newFromText( $l );
394406 $language_urls[] = array(
395407 'href' => $nt->getFullURL(),
396 - 'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l),
 408+ 'text' => ($wgLang->getLanguageName( $nt->getInterwiki()) != ''?$wgLang->getLanguageName( $nt->getInterwiki()) : $l),
397409 'class' => $class
398410 );
399411 }
@@ -887,7 +899,7 @@
888900 $fname = 'SkinTemplate::setupUserCss';
889901 wfProfileIn( $fname );
890902
891 - global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser;
 903+ global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, $wgLang, $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser;
892904
893905 $sitecss = '';
894906 $usercss = '';
@@ -911,7 +923,8 @@
912924 $siteargs .= '&ts=' . $wgUser->mTouched;
913925 }
914926
915 - if ($wgContLang->isRTL()) $sitecss .= '@import "' . $wgStylePath . '/' . $this->stylename . '/rtl.css";' . "\n";
 927+ if ($wgLang->isRTL()) $sitecss .= '@import "' . $wgStylePath . '/' . $this->stylename . '/rtl.css";' . "\n";
 928+ if ($wgContLang->isRTL()) $sitecss .= '@import "' . $wgStylePath . '/' . $this->stylename . '/content_rtl.css";' . "\n";
916929
917930 # If we use the site's dynamic CSS, throw that in, too
918931 if ( $wgUseSiteCss ) {
Index: trunk/phase3/includes/Skin.php
@@ -297,11 +297,12 @@
298298
299299 # get the user/site-specific stylesheet, SkinTemplate loads via RawPage.php (settings are cached that way)
300300 function getUserStylesheet() {
301 - global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage;
 301+ global $wgStylePath, $wgRequest, $wgLang, $wgContLang, $wgSquidMaxage;
302302 $sheet = $this->getStylesheet();
303303 $action = $wgRequest->getText('action');
304304 $s = "@import \"$wgStylePath/$sheet\";\n";
305 - if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css\";\n";
 305+ if($wgLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css\";\n";
 306+ if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_content_rtl.css\";\n";
306307
307308 $query = "action=raw&ctype=text/css&smaxage=$wgSquidMaxage";
308309 $s .= '@import "' . $this->makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) . "\";\n" .
@@ -434,7 +435,7 @@
435436 }
436437
437438 function doBeforeContent() {
438 - global $wgContLang;
 439+ global $wgLang;
439440 $fname = 'Skin::doBeforeContent';
440441 wfProfileIn( $fname );
441442
@@ -455,7 +456,7 @@
456457
457458 $shove = ($qb != 0);
458459 $left = ($qb == 1 || $qb == 3);
459 - if($wgContLang->isRTL()) $left = !$left;
 460+ if($wgLang->isRTL()) $left = !$left;
460461
461462 if ( !$shove ) {
462463 $s .= "<td class='top' align='left' valign='top' rowspan='{$rows}'>\n" .
@@ -463,13 +464,13 @@
464465 } elseif( $left ) {
465466 $s .= $this->getQuickbarCompensator( $rows );
466467 }
467 - $l = $wgContLang->isRTL() ? 'right' : 'left';
 468+ $l = $wgLang->isRTL() ? 'right' : 'left';
468469 $s .= "<td {$borderhack} align='$l' valign='top'>\n";
469470
470471 $s .= $this->topLinks() ;
471472 $s .= "<p class='subtitle'>" . $this->pageTitleLinks() . "</p>\n";
472473
473 - $r = $wgContLang->isRTL() ? "left" : "right";
 474+ $r = $wgLang->isRTL() ? "left" : "right";
474475 $s .= "</td>\n<td {$borderhack} valign='top' align='$r' nowrap='nowrap'>";
475476 $s .= $this->nameAndLogin();
476477 $s .= "\n<br />" . $this->searchForm() . "</td>";
@@ -996,7 +997,7 @@
997998 if ( '' != $align ) { $a = " align='{$align}'"; }
998999 else { $a = ''; }
9991000
1000 - $mp = wfMsg( 'mainpage' );
 1001+ $mp = wfMsgForContent( 'mainpage' );
10011002 $titleObj = Title::newFromText( $mp );
10021003 if ( is_object( $titleObj ) ) {
10031004 $url = $titleObj->escapeLocalURL();
@@ -1251,7 +1252,7 @@
12521253 }
12531254
12541255 function otherLanguages() {
1255 - global $wgOut, $wgContLang, $wgHideInterlanguageLinks;
 1256+ global $wgOut, $wgLang, $wgHideInterlanguageLinks;
12561257
12571258 if ( $wgHideInterlanguageLinks ) {
12581259 return '';
@@ -1264,20 +1265,20 @@
12651266
12661267 $s = wfMsg( 'otherlanguages' ) . ': ';
12671268 $first = true;
1268 - if($wgContLang->isRTL()) $s .= '<span dir="LTR">';
 1269+ if($wgLang->isRTL()) $s .= '<span dir="LTR">';
12691270 foreach( $a as $l ) {
12701271 if ( ! $first ) { $s .= ' | '; }
12711272 $first = false;
12721273
12731274 $nt = Title::newFromText( $l );
12741275 $url = $nt->escapeFullURL();
1275 - $text = $wgContLang->getLanguageName( $nt->getInterwiki() );
 1276+ $text = $wgLang->getLanguageName( $nt->getInterwiki() );
12761277
12771278 if ( '' == $text ) { $text = $l; }
12781279 $style = $this->getExternalLinkAttributes( $l, $text );
12791280 $s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
12801281 }
1281 - if($wgContLang->isRTL()) $s .= '</span>';
 1282+ if($wgLang->isRTL()) $s .= '</span>';
12821283 return $s;
12831284 }
12841285
Index: trunk/phase3/RELEASE-NOTES
@@ -391,8 +391,8 @@
392392 * (bug 6126) Allow fallback to customized primary language when user language
393393 message contains '-'; fixes licenses selector on Commons configuration after
394394 recent addition of the message to Messages.php
 395+* (bug 6100) BiDi: different directionality for user interface and wiki content
395396
396 -
397397 == Compatibility ==
398398
399399 MediaWiki 1.7 requires PHP 5 (5.1 recommended). PHP 4 is no longer supported.

Follow-up revisions

RevisionCommit summaryAuthorDate
r44000(bug 6100) Strip Unicode BiDi embedding/override characters (U+202A - U+202E)...vyznev20:11, 27 November 2008
r90264(part of bug 6100) Set the directionality based on user language instead of c...robin11:32, 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
r90517* Improvements as part of bug 6100: Use wfUILang() instead of $wgContLang whe...robin10:14, 21 June 2011
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

Status & tagging log