r37703 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37702‎ | r37703 | r37704 >
Date:16:49, 15 July 2008
Author:rainman
Status:old
Tags:
Comment:
Fix regreesion in r37662, disabled conversion when interface language variant is different that main wiki language variant.
Modified paths:
  • /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() && $code == $wgContLanguageCode ){
 151+ if( $wgContLang->hasVariants() && in_array($code, $wgContLang->getVariants()) ){
152152 $variant = $wgContLang->getPreferredVariant();
153153 if( $variant != $wgContLanguageCode )
154154 $code = $variant;
Index: trunk/phase3/languages/LanguageConverter.php
@@ -131,7 +131,7 @@
132132 $defaultUserLang = $this->mMainLanguageCode;
133133 $userLang = $wgRequest->getVal( 'uselang', $defaultUserLang );
134134 // see if interface language is same as content, if not, prevent conversion
135 - if( $this->mMainLanguageCode != $userLang ){
 135+ if( ! in_array( $userLang, $this->mVariants ) ){
136136 $this->mPreferredVariant = $this->mMainLanguageCode; // no conversion
137137 return $this->mPreferredVariant;
138138 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r37662* (bug 10837) Language variants overrides languages other than the variant ma...rainman21:32, 14 July 2008

Status & tagging log