r37662 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37661‎ | r37662 | r37663 >
Date:21:32, 14 July 2008
Author:rainman
Status:old
Tags:
Comment:
* (bug 10837) Language variants overrides languages other than the variant main language.
Explicitely forbid conversion when interface language is different than the main content language.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/StubObject.php (modified) (history)
  • /trunk/phase3/languages/LanguageConverter.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/StubObject.php
@@ -147,7 +147,7 @@
148148
149149 // if variant is explicitely selected, use it instead the one from wgUser
150150 // see bug #7605
151 - if( $wgContLang->hasVariants() ){
 151+ if( $wgContLang->hasVariants() && $code == $wgContLanguageCode ){
152152 $variant = $wgContLang->getPreferredVariant();
153153 if( $variant != $wgContLanguageCode )
154154 $code = $variant;
Index: trunk/phase3/languages/LanguageConverter.php
@@ -124,6 +124,14 @@
125125 if($this->mPreferredVariant)
126126 return $this->mPreferredVariant;
127127
 128+ // figure out user lang without constructing wgLang to avoid infinite recursion
 129+ $userLang = $wgRequest->getVal( 'uselang', $wgUser->getOption( 'language' ) );
 130+ // see if interface language is same as content, if not, prevent conversion
 131+ if( $this->mMainLanguageCode != $userLang ){
 132+ $this->mPreferredVariant = $this->mMainLanguageCode; // no conversion
 133+ return $this->mPreferredVariant;
 134+ }
 135+
128136 // see if the preference is set in the request
129137 $req = $wgRequest->getText( 'variant' );
130138 if( in_array( $req, $this->mVariants ) ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -432,6 +432,7 @@
433433 had stict standards issues with setFakeSlaveLag() and setFakeMaster().
434434 * (bug 451) Improve the phrase mappings of the Chinese converter arrays.
435435 * (bug 12487) Rights log is not fully internationalized
 436+* (bug 10837) Language variants no longer override other languages than base
436437
437438 === API changes in 1.13 ===
438439

Follow-up revisions

RevisionCommit summaryAuthorDate
r37668Sequel to r37662: avoid infinite recursion in User when default params are used.rainman22:20, 14 July 2008
r37703Fix regreesion in r37662, disabled conversion when interface language variant...rainman16:49, 15 July 2008
r51204* (bug 10837) Introducing the StubUserVariant class to determine the variant ...shinjiman19:49, 30 May 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r28802* Use variant only if interface language === content language...nikerabbit18:00, 23 December 2007

Status & tagging log