r91518 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91517‎ | r91518 | r91519 >
Date:02:26, 6 July 2011
Author:robin
Status:resolved (Comments)
Tags:todo 
Comment:
(bug 6100; follow-up to r91315) Being bold and removing $wgBetterDirectionality (and dependent wfUILang) in core, as most or all work is finished.
Also:
* Introduce classes mw-float-end, mw-float-start so we don't have to use inline css depending on wfUILang()/$wgLang (see HistoryPage and SpecialFileDuplicateSearch)
* Add direction mark to protection log
* Remove specialpageattributes as it is obsoleted by this commit (also fixes bug 28572)
* Add two direction marks in wfSpecialList, which makes ltr links on rtl wiki (and vice versa) display nicely as well (only on those special pages however)
* Revert r91340 partially: use mw-content-ltr/rtl class anyway in shared.css. Both ways have their [dis]advantages...
* Set the direction of input fields by default to the content language direction (except buttons etc.) in shared.css
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)
  • /trunk/phase3/includes/ChangesList.php (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/HistoryPage.php (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)
  • /trunk/phase3/includes/LogPage.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/Pager.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)
  • /trunk/phase3/includes/resourceloader/ResourceLoaderContext.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialAllmessages.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/SpecialWhatlinkshere.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)
  • /trunk/phase3/skins/Modern.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)
  • /trunk/phase3/skins/Vector.php (modified) (history)
  • /trunk/phase3/skins/common/shared.css (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -2351,10 +2351,14 @@
23522352 /**
23532353 * A hidden direction mark (LRM or RLM), depending on the language direction
23542354 *
 2355+ * @param $opposite Boolean Get the direction mark opposite to your language
23552356 * @return string
23562357 */
2357 - function getDirMark() {
2358 - return $this->isRTL() ? "\xE2\x80\x8F" : "\xE2\x80\x8E";
 2358+ function getDirMark( $opposite = false ) {
 2359+ $rtl = "\xE2\x80\x8F";
 2360+ $ltr = "\xE2\x80\x8E";
 2361+ if( $opposite ) { return $this->isRTL() ? $ltr : $rtl; }
 2362+ return $this->isRTL() ? $rtl : $ltr;
23592363 }
23602364
23612365 /**
Index: trunk/phase3/skins/common/shared.css
@@ -4,6 +4,23 @@
55 * another, but don't ignore the poor pre-Monobook users either.
66 */
77
 8+/* GENERAL CLASSES FOR DIRECTIONALITY SUPPORT */
 9+/* These classes should be used for text depending on the content direction.
 10+Content stuff like editsection, ul/ol and TOC depend on this. */
 11+ /* @noflip */.mw-content-ltr { direction: ltr; }
 12+/* @noflip */.mw-content-rtl { direction: rtl; }
 13+/* Most input fields should be in site direction */
 14+/* @noflip */.sitedir-ltr textarea, .sitedir-ltr input { direction: ltr; }
 15+/* @noflip */.sitedir-rtl textarea, .sitedir-rtl input { direction: rtl; }
 16+/* Input types that should follow user direction, like buttons */
 17+input[type="submit"], input[type="button"], input[type="reset"], input[type="file"] { direction: ltr; }
 18+/* Override default values */
 19+/* @noflip */textarea[dir="ltr"], input[dir="ltr"] { direction: ltr; }
 20+/* @noflip */textarea[dir="rtl"], input[dir="rtl"] { direction: rtl; }
 21+
 22+.mw-float-start { float: left; }
 23+.mw-float-end { float: right; }
 24+
825 /* The scripts of these languages are very hard to read with underlines */
926 [lang="ar"] a, [lang="ckb"] a, [lang="fa"] a, [lang="kk-arab"] a,
1027 [lang="mzn"] a, [lang="ps"] a, [lang="ur"] a {
@@ -69,8 +86,8 @@
7087 margin-left: 5px;
7188 }
7289 /* Correct directionality when page dir is different from site/user dir */
73 -/* @noflip */div#content [dir="ltr"] .editsection, div#content [dir="rtl"] [dir="ltr"] .editsection { float: right; }
74 -/* @noflip */div#content [dir="rtl"] .editsection, div#content [dir="ltr"] [dir="rtl"] .editsection { float: left; }
 90+/* @noflip */.mw-content-ltr .editsection, .mw-content-rtl .mw-content-ltr .editsection { float: right; }
 91+/* @noflip */.mw-content-rtl .editsection, .mw-content-ltr .mw-content-rtl .editsection { float: left; }
7592 /**
7693 * File histories
7794 */
@@ -625,12 +642,12 @@
626643 }
627644
628645 /* Correct directionality when page dir is different from site/user dir */
629 -/* @noflip */div#content [dir="ltr"] ul, div#content [dir="ltr"] ol,
630 -div#content [dir="rtl"] [dir="ltr"] ul, div#content [dir="rtl"] [dir="ltr"] ol {
 646+/* @noflip */.mw-content-ltr ul, .mw-content-ltr ol,
 647+.mw-content-rtl .mw-content-ltr ul, .mw-content-rtl .mw-content-ltr ol {
631648 margin: .3em 0 0 1.5em;
632649 }
633 -/* @noflip */div#content [dir="rtl"] ul, div#content [dir="rtl"] ol,
634 -div#content [dir="ltr"] [dir="rtl"] ul, div#content [dir="ltr"] [dir="rtl"] ol {
 650+/* @noflip */.mw-content-rtl ul, .mw-content-rtl ol,
 651+.mw-content-ltr .mw-content-rtl ul, .mw-content-ltr .mw-content-rtl ol {
635652 margin: .3em 1.5em 0 0;
636653 }
637654 /* Localised ordered list numbering for some languages */
@@ -660,22 +677,22 @@
661678 }
662679
663680 /* Correct directionality when page dir is different from site/user dir */
664 -/* @noflip */div#content [dir="ltr"] .toc ul, div#content [dir="ltr"] #toc ul,
665 -div#content [dir="rtl"] [dir="ltr"] .toc ul, div#content [dir="rtl"] [dir="ltr"] #toc ul {
 681+/* @noflip */.mw-content-ltr .toc ul, .mw-content-ltr #toc ul,
 682+.mw-content-rtl .mw-content-ltr .toc ul, .mw-content-rtl .mw-content-ltr #toc ul {
666683 text-align: left;
667684 margin-left: 0;
668685 }
669 -/* @noflip */div#content [dir="rtl"] .toc ul, div#content [dir="rtl"] #toc ul,
670 -div#content [dir="ltr"] [dir="rtl"] .toc ul, div#content [dir="ltr"] [dir="rtl"] #toc ul {
 686+/* @noflip */.mw-content-rtl .toc ul, .mw-content-rtl #toc ul,
 687+.mw-content-ltr .mw-content-rtl .toc ul, .mw-content-ltr .mw-content-rtl #toc ul {
671688 text-align: right;
672689 margin-right: 0;
673690 }
674 -/* @noflip */div#content [dir="ltr"] .toc ul ul, div#content [dir="ltr"] #toc ul ul,
675 -div#content [dir="rtl"] [dir="ltr"] .toc ul ul, div#content [dir="rtl"] [dir="ltr"] #toc ul ul {
 691+/* @noflip */.mw-content-ltr .toc ul ul, .mw-content-ltr #toc ul ul,
 692+.mw-content-rtl .mw-content-ltr .toc ul ul, .mw-content-rtl .mw-content-ltr #toc ul ul {
676693 margin: 0 0 0 2em;
677694 }
678 -/* @noflip */div#content [dir="rtl"] .toc ul ul, div#content [dir="rtl"] #toc ul ul,
679 -div#content [dir="ltr"] [dir="rtl"] .toc ul ul, div#content [dir="ltr"] [dir="rtl"] #toc ul ul {
 695+/* @noflip */.mw-content-rtl .toc ul ul, .mw-content-rtl #toc ul ul,
 696+.mw-content-ltr .mw-content-rtl .toc ul ul, .mw-content-ltr .mw-content-rtl #toc ul ul {
680697 margin: 0 2em 0 0;
681698 }
682699
Index: trunk/phase3/skins/Vector.php
@@ -135,7 +135,7 @@
136136 <div id="mw-page-base" class="noprint"></div>
137137 <div id="mw-head-base" class="noprint"></div>
138138 <!-- content -->
139 - <div id="content"<?php $this->html( 'specialpageattributes' ) ?>>
 139+ <div id="content">
140140 <a id="top"></a>
141141 <div id="mw-js-message" style="display:none;"<?php $this->html( 'userlangattributes' ) ?>></div>
142142 <?php if ( $this->data['sitenotice'] ): ?>
@@ -336,14 +336,14 @@
337337 * @param $elements array
338338 */
339339 private function renderNavigation( $elements ) {
340 - global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser;
 340+ global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser, $wgLang;
341341
342342 // If only one element was given, wrap it in an array, allowing more
343343 // flexible arguments
344344 if ( !is_array( $elements ) ) {
345345 $elements = array( $elements );
346346 // If there's a series of elements, reverse them when in RTL mode
347 - } elseif ( wfUILang()->isRTL() ) {
 347+ } elseif ( $wgLang->isRTL() ) {
348348 $elements = array_reverse( $elements );
349349 }
350350 // Render elements
Index: trunk/phase3/skins/MonoBook.php
@@ -77,7 +77,7 @@
7878
7979 $this->html( 'headelement' );
8080 ?><div id="globalWrapper">
81 -<div id="column-content"><div id="content"<?php $this->html("specialpageattributes") ?>>
 81+<div id="column-content"><div id="content">
8282 <a id="top"></a>
8383 <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
8484
Index: trunk/phase3/skins/Modern.php
@@ -70,7 +70,7 @@
7171 <!-- contentholder does nothing by default, but it allows users to style the text inside
7272 the content area without affecting the meaning of 'em' in #mw_content, which is used
7373 for the margins -->
74 - <div id="mw_contentholder" <?php $this->html("specialpageattributes") ?>>
 74+ <div id="mw_contentholder">
7575 <div class='mw-topboxes'>
7676 <div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes')?>></div>
7777 <div class="mw-topbox" id="siteSub"><?php $this->msg('tagline') ?></div>
Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -139,8 +139,8 @@
140140 * Make sure Backlink cache does not retrieve interwiki redirects when looking for
141141 redirects to a local page.
142142 * (bug 6100) Allow different directionality (LTR/RTL) for user interface
143 - and wiki content, when $wgBetterDirectionality is enabled, along with
144 - many RTL improvements (such as bugs 28030, 12406, 28349)
 143+ and wiki content, along with many other RTL and directionality improvements
 144+ (such as bugs 28030, 12406, 28349)
145145 * (bug 29712) Removed broken defaultUserOptionOverrides in MessagesXx files and
146146 unneeded CSS flipping of quickbar. Instead, introduce option 5 which sets
147147 left/right according to the directionality of your interface language.
Index: trunk/phase3/includes/HistoryPage.php
@@ -410,15 +410,13 @@
411411
412412 private function getRevisionButton( $name, $msg ) {
413413 $this->preventClickjacking();
414 - $float = wfUILang()->alignEnd();
415414 # Note bug #20966, <button> is non-standard in IE<8
416415 $element = Html::element( 'button',
417416 array(
418417 'type' => 'submit',
419418 'name' => $name,
420419 'value' => '1',
421 - 'style' => "float: $float;",
422 - 'class' => "mw-history-$name-button",
 420+ 'class' => "mw-history-$name-button mw-float-end",
423421 ),
424422 wfMsg( $msg )
425423 ) . "\n";
@@ -533,7 +531,7 @@
534532 $s .= " $del ";
535533 }
536534
537 - $dirmark = wfUILang()->getDirMark();
 535+ $dirmark = $wgLang->getDirMark();
538536
539537 $s .= " $link";
540538 $s .= $dirmark;
Index: trunk/phase3/includes/EditPage.php
@@ -1814,12 +1814,9 @@
18151815 'style' => '' // avoid php notices when appending preferences (appending allows customAttribs['style'] to still work
18161816 );
18171817
1818 - global $wgBetterDirectionality;
1819 - if( $wgBetterDirectionality ) {
1820 - $pageLang = $this->mTitle->getPageLanguage();
1821 - $attribs['lang'] = $pageLang->getCode();
1822 - $attribs['dir'] = $pageLang->getDir();
1823 - }
 1818+ $pageLang = $this->mTitle->getPageLanguage();
 1819+ $attribs['lang'] = $pageLang->getCode();
 1820+ $attribs['dir'] = $pageLang->getDir();
18241821
18251822 $wgOut->addHTML( Html::textarea( $name, $wikitext, $attribs ) );
18261823 }
@@ -2095,13 +2092,11 @@
20962093 '<h2 id="mw-previewheader">' . htmlspecialchars( wfMsg( 'preview' ) ) . "</h2>" .
20972094 $wgOut->parse( $note ) . $conflict . "</div>\n";
20982095
2099 - global $wgBetterDirectionality;
2100 - if( $wgBetterDirectionality ) {
2101 - $pageLang = $this->mTitle->getPageLanguage();
2102 - $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
2103 - 'class' => 'mw-content-'.$pageLang->getDir() );
2104 - $previewHTML = Html::rawElement( 'div', $attribs, $previewHTML );
2105 - }
 2096+ $pageLang = $this->mTitle->getPageLanguage();
 2097+ $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
 2098+ 'class' => 'mw-content-'.$pageLang->getDir() );
 2099+ $previewHTML = Html::rawElement( 'div', $attribs, $previewHTML );
 2100+
21062101 wfProfileOut( __METHOD__ );
21072102 return $previewhead . $previewHTML . $this->previewTextAfterContent;
21082103 }
Index: trunk/phase3/includes/ChangesList.php
@@ -323,6 +323,7 @@
324324 * @return void
325325 */
326326 public function insertArticleLink( &$s, &$rc, $unpatrolled, $watched ) {
 327+ global $wgLang;
327328 # If it's a new article, there is no diff link, but if it hasn't been
328329 # patrolled yet, we need to give users a way to do so
329330 $params = array();
@@ -354,7 +355,7 @@
355356 $articlelink = "<strong class=\"mw-watched\">{$articlelink}</strong>";
356357 }
357358 # RTL/LTR marker
358 - $articlelink .= wfUILang()->getDirMark();
 359+ $articlelink .= $wgLang->getDirMark();
359360
360361 wfRunHooks( 'ChangesListInsertArticleLink',
361362 array(&$this, &$articlelink, &$s, &$rc, $unpatrolled, $watched) );
@@ -590,7 +591,7 @@
591592 # User tool links
592593 $this->insertUserRelatedLinks( $s, $rc );
593594 # LTR/RTL direction mark
594 - $s .= wfUILang()->getDirMark();
 595+ $s .= $wgLang->getDirMark();
595596 # Log action text (if any)
596597 $this->insertAction( $s, $rc );
597598 # Edit or log comment
@@ -868,7 +869,7 @@
869870 $users = array();
870871 foreach( $userlinks as $userlink => $count) {
871872 $text = $userlink;
872 - $text .= wfUILang()->getDirMark();
 873+ $text .= $wgLang->getDirMark();
873874 if( $count > 1 ) {
874875 $text .= ' (' . $wgLang->formatNum( $count ) . '×)';
875876 }
@@ -910,7 +911,7 @@
911912 $this->insertArticleLink( $r, $block[0], $block[0]->unpatrolled, $block[0]->watched );
912913 }
913914
914 - $r .= wfUILang()->getDirMark();
 915+ $r .= $wgLang->getDirMark();
915916
916917 $queryParams['curid'] = $curId;
917918 # Changes message
Index: trunk/phase3/includes/Article.php
@@ -1043,13 +1043,13 @@
10441044 * @return string containing HMTL with redirect link
10451045 */
10461046 public function viewRedirect( $target, $appendSubtitle = true, $forceKnown = false ) {
1047 - global $wgOut, $wgStylePath;
 1047+ global $wgOut, $wgLang, $wgStylePath;
10481048
10491049 if ( !is_array( $target ) ) {
10501050 $target = array( $target );
10511051 }
10521052
1053 - $imageDir = wfUILang()->getDir();
 1053+ $imageDir = $wgLang->getDir();
10541054
10551055 if ( $appendSubtitle ) {
10561056 $wgOut->appendSubtitle( wfMsgHtml( 'redirectpagesub' ) );
@@ -1065,7 +1065,7 @@
10661066 }
10671067
10681068 $nextRedirect = $wgStylePath . '/common/images/nextredirect' . $imageDir . '.png';
1069 - $alt = wfUILang()->isRTL() ? '←' : '→';
 1069+ $alt = $wgLang->isRTL() ? '←' : '→';
10701070 // Automatically append redirect=no to each link, since most of them are redirect pages themselves.
10711071 foreach ( $target as $rt ) {
10721072 $link .= Html::element( 'img', array( 'src' => $nextRedirect, 'alt' => $alt ) );
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -910,17 +910,15 @@
911911 }
912912
913913 /**
914 - * Use this instead of $wgContLang, when working with user interface.
915 - * User interface is currently hard coded according to wiki content language
916 - * in many ways, especially regarding to text direction. There is lots stuff
917 - * to fix, hence this function to keep the old behaviour unless the global
918 - * $wgBetterDirectionality is enabled (or removed when everything works).
 914+ * Old function when $wgBetterDirectionality existed
 915+ * Removed in core, kept in extensions for backwards compat.
919916 *
 917+ * @deprecated since 1.19
920918 * @return Language
921919 */
922920 function wfUILang() {
923 - global $wgBetterDirectionality;
924 - return wfGetLangObj( !$wgBetterDirectionality );
 921+ global $wgLang;
 922+ return $wgLang;
925923 }
926924
927925 /**
@@ -2542,8 +2540,20 @@
25432541 return $func( $str, $needle ) !== false;
25442542 }
25452543
2546 -function wfSpecialList( $page, $details ) {
2547 - $details = $details ? ' ' . wfUILang()->getDirMark() . "($details)" : '';
 2544+/**
 2545+ * Make a list item, used by various special pages
 2546+ *
 2547+ * @param $page String Page link
 2548+ * @param $details String Text between brackets
 2549+ * @param $oppositedm Boolean Add the direction mark opposite to your
 2550+ * language, to display text properly
 2551+ * @return String
 2552+ */
 2553+function wfSpecialList( $page, $details, $oppositedm = true ) {
 2554+ global $wgLang;
 2555+ $dirmark = ( $oppositedm ? $wgLang->getDirMark( true ) : '' ) .
 2556+ $wgLang->getDirMark();
 2557+ $details = $details ? $dirmark . "($details)" : '';
25482558 return $page . $details;
25492559 }
25502560
Index: trunk/phase3/includes/LogEventsList.php
@@ -368,7 +368,8 @@
369369 $comment = '<span class="history-deleted">' .
370370 wfMsgHtml( 'rev-deleted-comment' ) . '</span>';
371371 } else {
372 - $comment = wfUILang()->getDirMark() .
 372+ global $wgLang;
 373+ $comment = $wgLang->getDirMark() .
373374 $this->skin->commentBlock( $row->log_comment );
374375 }
375376 return $comment;
Index: trunk/phase3/includes/CategoryPage.php
@@ -143,7 +143,7 @@
144144 * @return string HTML output
145145 */
146146 public function getHTML() {
147 - global $wgOut, $wgCategoryMagicGallery, $wgContLang, $wgBetterDirectionality;
 147+ global $wgOut, $wgCategoryMagicGallery, $wgContLang;
148148 wfProfileIn( __METHOD__ );
149149
150150 $this->showGallery = $wgCategoryMagicGallery && !$wgOut->mNoGallery;
@@ -174,13 +174,11 @@
175175 $r = wfMsgExt( 'category-empty', array( 'parse' ) );
176176 }
177177
178 - if( $wgBetterDirectionality ) {
179 - $pageLang = $this->title->getPageLanguage();
180 - $langAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() );
181 - # close the previous div, show the headings in user language,
182 - # then open a new div with the page content language again
183 - $r = '</div>' . $r . Html::openElement( 'div', $langAttribs );
184 - }
 178+ $pageLang = $this->title->getPageLanguage();
 179+ $langAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() );
 180+ # close the previous div, show the headings in user language,
 181+ # then open a new div with the page content language again
 182+ $r = '</div>' . $r . Html::openElement( 'div', $langAttribs );
185183
186184 wfProfileOut( __METHOD__ );
187185 return $wgContLang->convert( $r );
@@ -492,8 +490,6 @@
493491 * @private
494492 */
495493 function formatList( $articles, $articles_start_char, $cutoff = 6 ) {
496 - global $wgBetterDirectionality;
497 -
498494 $list = '';
499495 if ( count ( $articles ) > $cutoff ) {
500496 $list = self::columnList( $articles, $articles_start_char );
@@ -502,12 +498,10 @@
503499 $list = self::shortList( $articles, $articles_start_char );
504500 }
505501
506 - if( $wgBetterDirectionality ) {
507 - $pageLang = $this->title->getPageLanguage();
508 - $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
509 - 'class' => 'mw-content-'.$pageLang->getDir() );
510 - $list = Html::rawElement( 'div', $attribs, $list );
511 - }
 502+ $pageLang = $this->title->getPageLanguage();
 503+ $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
 504+ 'class' => 'mw-content-'.$pageLang->getDir() );
 505+ $list = Html::rawElement( 'div', $attribs, $list );
512506
513507 return $list;
514508 }
Index: trunk/phase3/includes/OutputPage.php
@@ -2257,15 +2257,14 @@
22582258 * @return String: The doctype, opening <html>, and head element.
22592259 */
22602260 public function headElement( Skin $sk, $includeStyle = true ) {
2261 - global $wgUseTrackbacks;
 2261+ global $wgUseTrackbacks, $wgLang;
22622262
22632263 if ( $sk->commonPrintStylesheet() ) {
22642264 $this->addModuleStyles( 'mediawiki.legacy.wikiprintable' );
22652265 }
22662266 $sk->setupUserCss( $this );
22672267
2268 - $lang = wfUILang();
2269 - $ret = Html::htmlHeader( array( 'lang' => $lang->getCode(), 'dir' => $lang->getDir() ) );
 2268+ $ret = Html::htmlHeader( array( 'lang' => $wgLang->getCode(), 'dir' => $wgLang->getDir() ) );
22702269
22712270 if ( $this->getHTMLTitle() == '' ) {
22722271 $this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ) );
@@ -2311,9 +2310,11 @@
23122311 Xml::escapeJsString( $editUrl ) . "'";
23132312 }
23142313
2315 - # Class bloat
2316 - $dir = wfUILang()->getDir();
2317 - $bodyAttrs['class'] = "mediawiki $dir";
 2314+ # Classes for LTR/RTL directionality support
 2315+ global $wgLang, $wgContLang;
 2316+ $userdir = $wgLang->getDir();
 2317+ $sitedir = $wgContLang->getDir();
 2318+ $bodyAttrs['class'] = "mediawiki $userdir sitedir-$sitedir";
23182319
23192320 if ( $this->getContext()->getLang()->capitalizeAllNouns() ) {
23202321 # A <body> class is probably not the best way to do this . . .
@@ -3020,8 +3021,8 @@
30213022 */
30223023 protected function styleLink( $style, $options ) {
30233024 if( isset( $options['dir'] ) ) {
3024 - $siteDir = wfUILang()->getDir();
3025 - if( $siteDir != $options['dir'] ) {
 3025+ global $wgLang;
 3026+ if( $wgLang->getDir() != $options['dir'] ) {
30263027 return '';
30273028 }
30283029 }
Index: trunk/phase3/includes/resourceloader/ResourceLoaderContext.php
@@ -140,11 +140,8 @@
141141 if ( $this->direction === null ) {
142142 $this->direction = $this->request->getVal( 'dir' );
143143 if ( !$this->direction ) {
144 - global $wgBetterDirectionality, $wgContLang;
145 - // if $wgBetterDirectionality is true, set
146 - // directionality based on user language (see bug 6100)
147 - $this->direction = ( $wgBetterDirectionality ?
148 - Language::factory( $this->language )->getDir() : $wgContLang->getDir() );
 144+ # directionality based on user language (see bug 6100)
 145+ $this->direction = Language::factory( $this->language )->getDir();
149146 }
150147 }
151148 return $this->direction;
Index: trunk/phase3/includes/ImagePage.php
@@ -124,8 +124,8 @@
125125
126126 # No need to display noarticletext, we use our own message, output in openShowImage()
127127 if ( $this->mPage->getID() ) {
128 - # When $wgBetterDirectionality is enabled, NS_FILE is in the user language,
129 - # but this section (the actual wikitext) should be in page content language
 128+ # NS_FILE is in the user language, but this section (the actual wikitext)
 129+ # should be in page content language
130130 $pageLang = $this->getTitle()->getPageLanguage();
131131 $wgOut->addHTML( Xml::openElement( 'div', array( 'id' => 'mw-imagepage-content',
132132 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
@@ -273,7 +273,7 @@
274274 $maxWidth = $max[0];
275275 $maxHeight = $max[1];
276276 $sk = $wgUser->getSkin();
277 - $dirmark = wfUILang()->getDirMark();
 277+ $dirmark = $wgLang->getDirMark();
278278
279279 if ( $this->displayImg->exists() ) {
280280 # image
Index: trunk/phase3/includes/Pager.php
@@ -947,7 +947,7 @@
948948 * A navigation bar with images
949949 */
950950 function getNavigationBar() {
951 - global $wgStylePath;
 951+ global $wgStylePath, $wgLang;
952952
953953 if ( !$this->isNavigationBarShown() ) {
954954 return '';
@@ -972,7 +972,7 @@
973973 'next' => 'arrow_disabled_right_25.png',
974974 'last' => 'arrow_disabled_last_25.png',
975975 );
976 - if( wfUILang()->isRTL() ) {
 976+ if( $wgLang->isRTL() ) {
977977 $keys = array_keys( $labels );
978978 $images = array_combine( $keys, array_reverse( $images ) );
979979 $disabledImages = array_combine( $keys, array_reverse( $disabledImages ) );
Index: trunk/phase3/includes/DefaultSettings.php
@@ -2408,9 +2408,12 @@
24092409 $wgEdititis = false;
24102410
24112411 /**
2412 - * Experimental better directionality support.
 2412+ * Better directionality support (bug 6100 and related).
 2413+ * Removed in 1.19, still kept here for LiquidThreads backwards compatibility.
 2414+ *
 2415+ * @deprecated since 1.19
24132416 */
2414 -$wgBetterDirectionality = false;
 2417+$wgBetterDirectionality = true;
24152418
24162419
24172420 /** @} */ # End of output format settings }
Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -934,14 +934,10 @@
935935 * @return string
936936 */
937937 function addHeader( $diff, $otitle, $ntitle, $multi = '', $notice = '' ) {
938 - global $wgBetterDirectionality;
939 - $tableClass = 'diff';
940 - if( $wgBetterDirectionality ) {
941 - // shared.css sets diff in interface language/dir,
942 - // but the actual content should be in the page language/dir
943 - $pageLang = $this->mTitle->getPageLanguage();
944 - $tableClass .= ' diff-contentalign-' . htmlspecialchars( $pageLang->alignStart() );
945 - }
 938+ // shared.css sets diff in interface language/dir,
 939+ // but the actual content should be in the page language/dir
 940+ $pageLang = $this->mTitle->getPageLanguage();
 941+ $tableClass = 'diff diff-contentalign-' . htmlspecialchars( $pageLang->alignStart() );
946942 $header = "<table class='$tableClass'>";
947943 if ( $diff ) { // Safari/Chrome show broken output if cols not used
948944 $header .= "
Index: trunk/phase3/includes/SkinTemplate.php
@@ -299,36 +299,31 @@
300300 $tpl->setRef( 'serverurl', $wgServer );
301301 $tpl->setRef( 'logopath', $wgLogo );
302302
303 - $lang = wfUILang();
304 - $tpl->set( 'lang', $lang->getCode() );
305 - $tpl->set( 'dir', $lang->getDir() );
306 - $tpl->set( 'rtl', $lang->isRTL() );
 303+ $contentlang = $wgContLang->getCode();
 304+ $contentdir = $wgContLang->getDir();
 305+ $userlang = $wgLang->getCode();
 306+ $userdir = $wgLang->getDir();
307307
 308+ $tpl->set( 'lang', $userlang );
 309+ $tpl->set( 'dir', $userdir );
 310+ $tpl->set( 'rtl', $wgLang->isRTL() );
 311+
308312 $tpl->set( 'capitalizeallnouns', $wgLang->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' );
309313 $tpl->set( 'showjumplinks', $wgUser->getOption( 'showjumplinks' ) );
310314 $tpl->set( 'username', $wgUser->isAnon() ? null : $this->username );
311315 $tpl->setRef( 'userpage', $this->userpage );
312316 $tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] );
313 - $tpl->set( 'userlang', $wgLang->getCode() );
 317+ $tpl->set( 'userlang', $userlang );
314318
315319 // Users can have their language set differently than the
316320 // content of the wiki. For these users, tell the web browser
317321 // that interface elements are in a different language.
318322 $tpl->set( 'userlangattributes', '' );
319 - $tpl->set( 'specialpageattributes', '' );
 323+ $tpl->set( 'specialpageattributes', '' ); # obsolete
320324
321 - $lang = $wgLang->getCode();
322 - $dir = $wgLang->getDir();
323 - if ( $lang !== $wgContLang->getCode() || $dir !== $wgContLang->getDir() ) {
324 - $attrs = " lang='$lang' dir='$dir'";
325 -
 325+ if ( $userlang !== $contentlang || $userdir !== $contentdir ) {
 326+ $attrs = " lang='$userlang' dir='$userdir'";
326327 $tpl->set( 'userlangattributes', $attrs );
327 -
328 - // The content of SpecialPages should be presented in the
329 - // user's language. Content of regular pages should not be touched.
330 - if( $this->getTitle()->isSpecialPage() ) {
331 - $tpl->set( 'specialpageattributes', $attrs );
332 - }
333328 }
334329
335330 $newtalks = $this->getNewtalks( $out );
@@ -454,19 +449,18 @@
455450 $tpl->set( 'bottomscripts', $this->bottomScripts( $out ) );
456451 $tpl->set( 'printfooter', $this->printSource() );
457452
458 - global $wgBetterDirectionality;
459 - if ( $wgBetterDirectionality ) {
460 - // not for special pages or file pages AND only when viewing AND if the page exists
461 - // (or is in MW namespace, because that has default content)
462 - if( !in_array( $this->getTitle()->getNamespace(), array( NS_SPECIAL, NS_FILE ) ) &&
463 - in_array( $action, array( 'view', 'render', 'print' ) ) &&
464 - ( $this->getTitle()->exists() || $this->getTitle()->getNamespace() == NS_MEDIAWIKI ) ) {
465 - $pageLang = $this->getTitle()->getPageLanguage();
466 - $realBodyAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
467 - 'class' => 'mw-content-'.$pageLang->getDir() );
468 - $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext );
469 - }
 453+ # Add a <div class="mw-content-ltr/rtl"> around the body text
 454+ # not for special pages or file pages AND only when viewing AND if the page exists
 455+ # (or is in MW namespace, because that has default content)
 456+ if( !in_array( $this->getTitle()->getNamespace(), array( NS_SPECIAL, NS_FILE ) ) &&
 457+ in_array( $action, array( 'view', 'render', 'print' ) ) &&
 458+ ( $this->getTitle()->exists() || $this->getTitle()->getNamespace() == NS_MEDIAWIKI ) ) {
 459+ $pageLang = $this->getTitle()->getPageLanguage();
 460+ $realBodyAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
 461+ 'class' => 'mw-content-'.$pageLang->getDir() );
 462+ $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext );
470463 }
 464+
471465 $tpl->setRef( 'bodytext', $out->mBodytext );
472466
473467 # Language links
Index: trunk/phase3/includes/specials/SpecialDoubleRedirects.php
@@ -76,6 +76,8 @@
7777 }
7878
7979 function formatResult( $skin, $result ) {
 80+ global $wgLang;
 81+
8082 $titleA = Title::makeTitle( $result->namespace, $result->title );
8183
8284 if ( $result && !isset( $result->nsb ) ) {
@@ -117,7 +119,7 @@
118120 array( 'redirect' => 'no' )
119121 );
120122 $linkC = $skin->linkKnown( $titleC );
121 - $arr = wfUILang()->getArrow() . wfUILang()->getDirMark();
 123+ $arr = $wgLang->getArrow() . $wgLang->getDirMark();
122124
123125 return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
124126 }
Index: trunk/phase3/includes/specials/SpecialListredirects.php
@@ -108,8 +108,9 @@
109109 # Find out where the redirect leads
110110 $target = $this->getRedirectTarget( $result );
111111 if( $target ) {
 112+ global $wgLang;
112113 # Make a link to the destination page
113 - $arr = wfUILang()->getArrow() . wfUILang()->getDirMark();
 114+ $arr = $wgLang->getArrow() . $wgLang->getDirMark();
114115 $targetLink = $skin->link( $target );
115116 return "$rd_link $arr $targetLink";
116117 } else {
Index: trunk/phase3/includes/specials/SpecialAllmessages.php
@@ -411,8 +411,7 @@
412412 }
413413
414414 function getCellAttrs( $field, $value ){
415 - global $wgBetterDirectionality;
416 - if( $field != 'am_title' && $wgBetterDirectionality ) {
 415+ if( $field != 'am_title' ) {
417416 return array( 'lang' => $this->langcode, 'dir' => $this->lang->getDir() );
418417 } elseif( $this->mCurrentRow->am_customised && $field == 'am_title' ) {
419418 return array( 'rowspan' => '2', 'class' => $field );
Index: trunk/phase3/includes/specials/SpecialShortpages.php
@@ -87,7 +87,7 @@
8888
8989 function formatResult( $skin, $result ) {
9090 global $wgLang;
91 - $dm = wfUILang()->getDirMark();
 91+ $dm = $wgLang->getDirMark();
9292
9393 $title = Title::makeTitle( $result->namespace, $result->title );
9494 if ( !$title ) {
Index: trunk/phase3/includes/specials/SpecialDisambiguations.php
@@ -122,13 +122,15 @@
123123 }
124124
125125 function formatResult( $skin, $result ) {
 126+ global $wgLang;
 127+
126128 $title = Title::newFromID( $result->value );
127129 $dp = Title::makeTitle( $result->namespace, $result->title );
128130
129131 $from = $skin->link( $title );
130132 $edit = $skin->link( $title, wfMsgExt( 'parentheses', array( 'escape' ), wfMsg( 'editlink' ) ) ,
131133 array(), array( 'redirect' => 'no', 'action' => 'edit' ) );
132 - $arr = wfUILang()->getArrow();
 134+ $arr = $wgLang->getArrow();
133135 $to = $skin->link( $dp );
134136
135137 return "$from $edit $arr $to";
Index: trunk/phase3/includes/specials/SpecialBrokenRedirects.php
@@ -116,7 +116,7 @@
117117 array(),
118118 array( 'broken' )
119119 );
120 - $arr = wfUILang()->getArrow();
 120+ $arr = $wgLang->getArrow();
121121
122122 $out = $from . wfMsg( 'word-separator' );
123123
Index: trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php
@@ -126,14 +126,12 @@
127127 }
128128
129129 if( $this->hash != '' ) {
130 - $align = wfUILang()->alignEnd();
131 -
132130 # Show a thumbnail of the file
133131 $img = $this->file;
134132 if ( $img ) {
135133 $thumb = $img->transform( array( 'width' => 120, 'height' => 120 ) );
136134 if( $thumb ) {
137 - $wgOut->addHTML( '<div style="float:' . $align . '" id="mw-fileduplicatesearch-icon">' .
 135+ $wgOut->addHTML( '<div class="mw-float-end" id="mw-fileduplicatesearch-icon">' .
138136 $thumb->toHtml( array( 'desc-link' => false ) ) . '<br />' .
139137 wfMsgExt( 'fileduplicatesearch-info', array( 'parse' ),
140138 $wgLang->formatNum( $img->getWidth() ),
Index: trunk/phase3/includes/specials/SpecialWhatlinkshere.php
@@ -268,6 +268,9 @@
269269 }
270270
271271 protected function listItem( $row, $nt, $notClose = false ) {
 272+ global $wgLang;
 273+ $dirmark = $wgLang->getDirMark();
 274+
272275 # local message cache
273276 static $msgcache = null;
274277 if ( $msgcache === null ) {
@@ -310,7 +313,6 @@
311314 $wlhLink = $this->wlhLink( $nt, $msgcache['whatlinkshere-links'] );
312315 $wlh = Xml::wrapClass( "($wlhLink)", 'mw-whatlinkshere-tools' );
313316
314 - $dirmark = wfUILang()->getDirMark();
315317 return $notClose ?
316318 Xml::openElement( 'li' ) . "$link $propsText $dirmark $wlh\n" :
317319 Xml::tags( 'li', null, "$link $propsText $dirmark $wlh" ) . "\n";
Index: trunk/phase3/includes/specials/SpecialProtectedpages.php
@@ -116,7 +116,7 @@
117117 }
118118
119119 if(!is_null($size = $row->page_len)) {
120 - $stxt = wfUILang()->getDirMark() . ' ' . $skin->formatRevisionSize( $size );
 120+ $stxt = $wgLang->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
@@ -145,7 +145,7 @@
146146 return Html::rawElement(
147147 'li',
148148 array(),
149 - wfSpecialList( $link . $stxt, $wgLang->commaList( $description_items ) ) . $changeProtection ) . "\n";
 149+ wfSpecialList( $link . $stxt, $wgLang->commaList( $description_items ), false ) . $changeProtection ) . "\n";
150150 }
151151
152152 /**
Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -627,7 +627,7 @@
628628 array( 'action' => 'history' )
629629 );
630630
631 - $comment = wfUILang()->getDirMark() . $sk->revComment( $rev, false, true );
 631+ $comment = $wgLang->getDirMark() . $sk->revComment( $rev, false, true );
632632 $date = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
633633 if( $rev->userCan( Revision::DELETED_TEXT ) ) {
634634 $d = $sk->linkKnown(
@@ -684,7 +684,7 @@
685685 $diffHistLinks = '(' . $difftext . $this->messages['pipe-separator'] . $histlink . ')';
686686
687687
688 - $diffOut = ' . . ' . wfUILang()->getDirMark() . ( $this->showSizeDiff ?
 688+ $diffOut = ' . . ' . $wgLang->getDirMark() . ( $this->showSizeDiff ?
689689 ChangesList::showCharacterDifference( $row->rc_old_len, $row->rc_new_len ) : Linker::formatRevisionSize( $row->rev_len ) );
690690
691691 $ret = "{$del}{$d} {$diffHistLinks} {$nflag}{$mflag} {$link}{$diffOut}{$userlink} {$comment} {$topmarktext}";
Index: trunk/phase3/includes/specials/SpecialNewpages.php
@@ -302,7 +302,7 @@
303303
304304 $classes = array();
305305
306 - $dm = wfUILang()->getDirMark();
 306+ $dm = $wgLang->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/LogPage.php
@@ -259,7 +259,7 @@
260260 } elseif ( $type == 'protect' && count($params) == 3 ) {
261261 // Restrictions and expiries
262262 if( $skin ) {
263 - $details .= htmlspecialchars( " {$params[1]}" );
 263+ $details .= $wgLang->getDirMark() . htmlspecialchars( " {$params[1]}" );
264264 } else {
265265 $details .= " {$params[1]}";
266266 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r91519(follow-up r91518; bug 29658 et al.) Improving RTL support for several extens...robin02:44, 6 July 2011
r92574Follow-up r91518platonides20:36, 19 July 2011
r94279* CategoryPage.php: fix the "category-empty" message per comment on r91518, i...robin19:58, 11 August 2011
r94299merge r94279 partially (fix for r91518): 'category-empty' was outside bodyCon...robin23:19, 11 August 2011
r96764Fix standard skin, which doesn't style ul/ol. The margin added in shared.css ...robin00:57, 11 September 2011
r96888MFT r96886: backport to fix bug 30865 on 1.18...brion19:25, 12 September 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
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
r91340* Put float:left/right for images in shared.css with @noflip. This was incons...robin01:57, 2 July 2011

Comments

#Comment by SPQRobin (talk | contribs)   02:34, 6 July 2011

Also, introducing 'sitedir-ltr/rtl' classes on body, as this is now different from 'ltr/rtl' class on body (btw, that should probably be renamed to 'userdir-ltr/rtl', as it conflicts with other classes).

#Comment by Krinkle (talk | contribs)   15:01, 11 August 2011

Somewhere around this commit, not exactly sure it's this one, the message "This category currently contains no pages or media." (msg key "category-empty") is shown outside the bodyContent on non-existant category pages of empty categories.

See http://translatewiki.net/wiki/Category:Xklada for example.

The closing "‎</div>" on line 181 is the problem here

#Comment by SPQRobin (talk | contribs)   20:00, 11 August 2011

Fixed in r94279, along with a much bigger bug that I discovered while fixing this...

#Comment by Krinkle (talk | contribs)   15:02, 11 August 2011
<div id="bodyContent">
....
</div>
<p>
  <i> This category currently contains no pages or media.</i>
</p>
#Comment by Krinkle (talk | contribs)   16:14, 31 August 2011

Regarding the [[[:Template:ViewVC]] changes to shared.css in this commit]

What is the point of having selectors like these:

.foo-ltr,
.foo-rtl .foo-ltr {
  something: for ltr userlang;
}

A lot of the power of CSS comes down to assigning priority/points to each selector and using those for each element separately. A more specific selector always has a higher value. For that reason, afaik, there is no reason to have both here, just .foo-ltr is sufficient.

Check the demo on translatewiki.net showing nested elements like this without the need to 'override' that styling.

#Comment by SPQRobin (talk | contribs)   00:41, 11 September 2011

The .foo-ltr .foo-rtl is needed for the CSS to override the .foo-ltr CSS. I added list items to your page, so that you can see that. The whole page has a "mw-content-ltr" class, which gets the styling. When using a "mw-content-rtl" class within that page (when a certain page is RTL but wgContLang is LTR, such as on translatewiki), the styling of .mw-content-ltr .mw-content-rtl is used. You can see that on the third level (ltr > rtl > ltr), the list does not display properly because there is no .mw-content-ltr .mw-content-rtl .mw-content-ltr (which is not needed obviously, as you should use the first level).

This should probably remain until we can properly mark the page language/direction. (Even then, it may be useful to have RTL text within a LTR page and vice versa).

I know I added relatively much CSS, but I did not find a good way to do it otherwise.

#Comment by Bawolff (talk | contribs)   18:06, 12 September 2011

This appears to cause bug 30865 (List of category members is outside #bodyContent if the article for the category does not exist)

Marking fixme.

#Comment by Krinkle (talk | contribs)   19:23, 12 September 2011

This was also happening earlier on LQT talk pages as reported above in #c20629 and #c20630

#Comment by SPQRobin (talk | contribs)   20:54, 12 September 2011

Fixed by Brion in r96886.

#Comment by Tim Starling (talk | contribs)   07:02, 13 September 2011

It looks like all of the special pages are broken, I can't find any special page that is displaying content language text with the correct direction. History pages, log snippets, etc. are all broken. To me it looks to me like only a small fraction of the required work is done.

Before we enable this on Wikimedia, it should be in a state where it's unambiguously better than how it was in 1.17. This is definitely better than the situation before r81622. But every content language text snippet apart from the main content area is now backwards, and it's not clear to me whether that's an acceptable tradeoff to get the UI text going in the correct direction.

I suggest reinstating $wgBetterDirectionality.

#Comment by Nikerabbit (talk | contribs)   08:05, 13 September 2011

I wonder where this stark contrast between broken/looks fine comes from. For example the history pages look acceptable to me: http://translatewiki.net/w/i.php?title=Main_Page&action=history&uselang=he There is a small problem about the punctuation marks being on the wrong side of the comments, but is that a blocker?

#Comment by Tim Starling (talk | contribs)   11:48, 13 September 2011

Setting a correct direction on elements that contain RTL text is what this project is all about. If you set the wrong direction, the effect ranges from nothing at all to total unreadable breakage, depending on the text that the element contains. The first things to go are the punctuation characters, they are like canaries.

Because you can't tell what direction most of the elements have just by looking at them, to test this feature, I had to develop a special debugging tool to indicate text direction. I committed it just now to extensions/RTLDebug.

#Comment by SPQRobin (talk | contribs)   21:08, 13 September 2011

Nobody who used MediaWiki with the RTL improvements ever made an issue about special pages, history pages and log snippets being "broken". (Even then, a lot of the work is done, not just a small fraction. It's way better than it was before.)

History lists and log entries are mostly in the user languages, with only the edit summary being in the content language (presumably). It does not make sense to align these lists to the content direction, this would be incorrect for the text in the user language. Having it aligned to the user language direction is in my POV a usability advantage as well.

It should rather be the improvements in HTML5 that should be implemented in browsers. From a MediaWiki perspective, we have good bidi support.

#Comment by Catrope (talk | contribs)   10:09, 14 September 2011

History lists and log entries are mostly in the user languages, with only the edit summary being in the content language (presumably). It does not make sense to align these lists to the content direction, this would be incorrect for the text in the user language. Having it aligned to the user language direction is in my POV a usability advantage as well.

That's not what Tim was suggesting. If I read his comment, and the surrounding sentiment on IRC at the time, correctly, what he meant was that the directionality of the interface as a whole is correct, it's just that things like edit summaries need to be wrapped in spans that give them the directionality of the content language, not of the user language. Other things that need content language directionality but don't currently have it are page titles (most special pages have the content directionality for the text box where you can type page titles, but display the titles in user directionality where they appear in lists etc. Whatlinkshere is a good example of this inconsistent behavior) and user names (except IPs, maybe? What's the "right" way to display an IP address in an RTL language? I see how things could get very confusing if they're displayed the wrong way around).

#Comment by Amire80 (talk | contribs)   23:18, 15 September 2011

I just looked at all the special pages at TranslateWiki with Hebrew as my interface and i didn't find practically any huge problems.

I only found minor problems at these pages:

So either i am misunderstanding something or the current problems are really minor.

#Comment by Tim Starling (talk | contribs)   00:23, 16 September 2011

We can go to beta testing on it, but it would be nice if we still had $wgBetterDirectionality at the time of deployment, in case there are serious complaints and we need to turn it off.

Status & tagging log