diff options
author | Robin Pepermans <robin@users.mediawiki.org> | 2011-09-22 20:31:23 +0000 |
---|---|---|
committer | Robin Pepermans <robin@users.mediawiki.org> | 2011-09-22 20:31:23 +0000 |
commit | 07dc087494f3f954d3ecec01398bdde3eec5f948 (patch) | |
tree | a139331f30a4ecf6fc289c8253a899c512b8e66b /includes/SkinTemplate.php | |
parent | 0414bc3cc386fa4433db2883c376f847dc7b79a4 (diff) | |
download | mediawikicore-07dc087494f3f954d3ecec01398bdde3eec5f948.tar.gz mediawikicore-07dc087494f3f954d3ecec01398bdde3eec5f948.zip |
Re-do r96798 ("LanguageConverter now depends on the page content language"), without the change in WikiPage which caused an infinite loop (see bug 31098)
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/97849
Diffstat (limited to 'includes/SkinTemplate.php')
-rw-r--r-- | includes/SkinTemplate.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index ea6274dd9722..b4f299aba008 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -1011,16 +1011,21 @@ class SkinTemplate extends Skin { array( &$this, &$content_navigation ) ); } + $pageLang = $title->getPageLanguage(); + // Gets list of language variants - $variants = $wgContLang->getVariants(); + $variants = $pageLang->getVariants(); // Checks that language conversion is enabled and variants exist - if( !$wgDisableLangConversion && count( $variants ) > 1 ) { - // Gets preferred variant - $preferred = $wgContLang->getPreferredVariant(); + // And if it is not in the special namespace + if( !$wgDisableLangConversion && count( $variants ) > 1 + && $title->getNamespace() != NS_SPECIAL ) { + // Gets preferred variant (note that user preference is + // only possible for wiki content language variant) + $preferred = $pageLang->getPreferredVariant(); // Loops over each variant foreach( $variants as $code ) { // Gets variant name from language code - $varname = $wgContLang->getVariantname( $code ); + $varname = $pageLang->getVariantname( $code ); // Checks if the variant is marked as disabled if( $varname == 'disable' ) { // Skips this variant |