Index: trunk/phase3/includes/Article.php |
— | — | @@ -1050,13 +1050,14 @@ |
1051 | 1051 | * @return string containing HMTL with redirect link |
1052 | 1052 | */ |
1053 | 1053 | public function viewRedirect( $target, $appendSubtitle = true, $forceKnown = false ) { |
1054 | | - global $wgOut, $wgLang, $wgStylePath; |
| 1054 | + global $wgOut, $wgStylePath; |
1055 | 1055 | |
1056 | 1056 | if ( !is_array( $target ) ) { |
1057 | 1057 | $target = array( $target ); |
1058 | 1058 | } |
1059 | 1059 | |
1060 | | - $imageDir = $wgLang->getDir(); |
| 1060 | + $lang = $this->getTitle()->getPageLanguage(); |
| 1061 | + $imageDir = $lang->getDir(); |
1061 | 1062 | |
1062 | 1063 | if ( $appendSubtitle ) { |
1063 | 1064 | $wgOut->appendSubtitle( wfMsgHtml( 'redirectpagesub' ) ); |
— | — | @@ -1072,7 +1073,7 @@ |
1073 | 1074 | } |
1074 | 1075 | |
1075 | 1076 | $nextRedirect = $wgStylePath . '/common/images/nextredirect' . $imageDir . '.png'; |
1076 | | - $alt = $wgLang->isRTL() ? '←' : '→'; |
| 1077 | + $alt = $lang->isRTL() ? '←' : '→'; |
1077 | 1078 | // Automatically append redirect=no to each link, since most of them are redirect pages themselves. |
1078 | 1079 | foreach ( $target as $rt ) { |
1079 | 1080 | $link .= Html::element( 'img', array( 'src' => $nextRedirect, 'alt' => $alt ) ); |
Index: trunk/phase3/includes/parser/ParserOptions.php |
— | — | @@ -274,9 +274,11 @@ |
275 | 275 | * settings. |
276 | 276 | * |
277 | 277 | * @since 1.17 |
| 278 | + * @param $forOptions Array |
| 279 | + * @param $title Title: will be used to get the page content language |
278 | 280 | * @return \string Page rendering hash |
279 | 281 | */ |
280 | | - public function optionsHash( $forOptions ) { |
| 282 | + public function optionsHash( $forOptions, $title = null ) { |
281 | 283 | global $wgContLang, $wgRenderHashAppend; |
282 | 284 | |
283 | 285 | $confstr = ''; |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -4376,9 +4376,6 @@ |
4377 | 4377 | if ( $this->getNamespace() == NS_SPECIAL ) { |
4378 | 4378 | // special pages are in the user language |
4379 | 4379 | return $wgLang; |
4380 | | - } elseif ( $this->isRedirect() ) { |
4381 | | - // the arrow on a redirect page is aligned according to the user language |
4382 | | - return $wgLang; |
4383 | 4380 | } elseif ( $this->isCssOrJsPage() ) { |
4384 | 4381 | // css/js should always be LTR and is, in fact, English |
4385 | 4382 | return wfGetLangObj( 'en' ); |
Index: trunk/phase3/languages/LanguageConverter.php |
— | — | @@ -158,7 +158,7 @@ |
159 | 159 | // not memoized (i.e. there return value is not cached) since |
160 | 160 | // new information might appear during processing after this |
161 | 161 | // is first called. |
162 | | - if ( $req ) { |
| 162 | + if ( $this->validateVariant( $req ) ) { |
163 | 163 | return $req; |
164 | 164 | } |
165 | 165 | return $this->mMainLanguageCode; |
— | — | @@ -1369,14 +1369,16 @@ |
1370 | 1370 | // then we check its fallback variants. |
1371 | 1371 | $variantFallbacks = |
1372 | 1372 | $this->mConverter->getVariantFallbacks( $variant ); |
1373 | | - foreach ( $variantFallbacks as $variantFallback ) { |
1374 | | - // if current variant's fallback exist in flags |
1375 | | - if ( isset( $this->mVariantFlags[$variantFallback] ) ) { |
1376 | | - // then convert <text to convert> to fallback language |
1377 | | - $this->mRules = |
1378 | | - $this->mConverter->autoConvert( $this->mRules, |
1379 | | - $variantFallback ); |
1380 | | - break; |
| 1373 | + if( is_array( $variantFallbacks ) ) { |
| 1374 | + foreach ( $variantFallbacks as $variantFallback ) { |
| 1375 | + // if current variant's fallback exist in flags |
| 1376 | + if ( isset( $this->mVariantFlags[$variantFallback] ) ) { |
| 1377 | + // then convert <text to convert> to fallback language |
| 1378 | + $this->mRules = |
| 1379 | + $this->mConverter->autoConvert( $this->mRules, |
| 1380 | + $variantFallback ); |
| 1381 | + break; |
| 1382 | + } |
1381 | 1383 | } |
1382 | 1384 | } |
1383 | 1385 | } |