r90264 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90263‎ | r90264 | r90265 >
Date:11:32, 17 June 2011
Author:robin
Status:ok (Comments)
Tags:
Comment:
(part of bug 6100) Set the directionality based on user language instead of content language (as in r81622, but only when $wgBetterDirectionality is enabled)
Modified paths:
  • /trunk/phase3/includes/resourceloader/ResourceLoaderContext.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/resourceloader/ResourceLoaderContext.php
@@ -140,8 +140,11 @@
141141 if ( $this->direction === null ) {
142142 $this->direction = $this->request->getVal( 'dir' );
143143 if ( !$this->direction ) {
144 - global $wgContLang;
145 - $this->direction = $wgContLang->getDir();
 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() );
146149 }
147150 }
148151 return $this->direction;

Follow-up revisions

RevisionCommit summaryAuthorDate
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

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
r81622Use the content language to set the skin direction, instead of the user langu...tstarling12:39, 7 February 2011

Comments

#Comment by Nikerabbit (talk | contribs)   12:45, 17 June 2011

Does this affect CSS ltr/rtl flipping?

#Comment by SPQRobin (talk | contribs)   13:00, 17 June 2011

If you set an RTL language as user language on an LTR wiki, the LTR layout is flipped to RTL (as wanted on bug 6100). (you can see what it does here: http://robinpepermans.be/mw-dev/index.php?title=Main_Page&uselang=ar - I enabled $wgBetterDirectionality there)

#Comment by MarkAHershberger (talk | contribs)   17:11, 17 June 2011

NICE!

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

Interface can only be in one direction (assuming it is fully translated), but content can in principal be in different directions (even in the same page), so it makes sense to flip the interface rules and carefully craft rules for content that work for both directions.

#Comment by SPQRobin (talk | contribs)   00:07, 25 August 2011

Indeed, that is how it is done (in my other commits).

Status & tagging log