Index: trunk/phase3/includes/StubObject.php |
— | — | @@ -91,13 +91,16 @@ |
92 | 92 | global $wgContLanguageCode, $wgRequest, $wgUser, $wgContLang; |
93 | 93 | $code = $wgRequest->getVal('uselang', $wgUser->getOption('language') ); |
94 | 94 | |
95 | | - // if variant is explicitely selected, use it instead the one from wgUser |
96 | | - // see bug #7605 |
97 | | - if($wgContLang->hasVariants()){ |
98 | | - $variant = $wgContLang->getPreferredVariant(); |
99 | | - if($variant != $wgContLanguageCode) |
100 | | - $code = $variant; |
101 | | - } |
| 95 | + // IF the content language has variants... |
| 96 | + if ( $wgContLang->hasVariants() ) { |
| 97 | + // AND IF the current interface language is the same as content language |
| 98 | + if ( $code === $wgContLanguageCode ) { |
| 99 | + // THEN use preferred variant as interface language. |
| 100 | + // Happens when anonymous users or logged in users with default language |
| 101 | + // setting selects a variant conversion. |
| 102 | + $code = $wgContLang->getPreferredVariant(); |
| 103 | + } |
| 104 | + } |
102 | 105 | |
103 | 106 | # Validate $code |
104 | 107 | if( empty( $code ) || !preg_match( '/^[a-z-]+$/', $code ) ) { |
— | — | @@ -105,7 +108,7 @@ |
106 | 109 | $code = $wgContLanguageCode; |
107 | 110 | } |
108 | 111 | |
109 | | - if( $code == $wgContLanguageCode ) { |
| 112 | + if( $code === $wgContLanguageCode ) { |
110 | 113 | return $wgContLang; |
111 | 114 | } else { |
112 | 115 | $obj = Language::factory( $code ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -268,6 +268,7 @@ |
269 | 269 | * (bug 12371) Handle more namespace case variants in namespaceDupes.php |
270 | 270 | * (bug 12380) Bot-friendly EditPage::spamPage |
271 | 271 | * (bug 8066) Spaces can't be entered in special page aliases |
| 272 | +* (bug 10837) Interface "variant" overruling "language" preference |
272 | 273 | |
273 | 274 | == Parser changes in 1.12 == |
274 | 275 | |