Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -1901,11 +1901,9 @@ |
1902 | 1902 | |
1903 | 1903 | # Link not escaped by : , create the various objects |
1904 | 1904 | if ( $noforce ) { |
1905 | | - global $wgContLang; |
1906 | | - |
1907 | 1905 | # Interwikis |
1908 | 1906 | wfProfileIn( __METHOD__."-interwiki" ); |
1909 | | - if ( $iw && $this->mOptions->getInterwikiMagic() && $nottalk && $wgContLang->getLanguageName( $iw ) ) { |
| 1907 | + if ( $iw && $this->mOptions->getInterwikiMagic() && $nottalk && Language::fetchLanguageName( $iw, null, 'mw' ) ) { |
1910 | 1908 | $this->mOutput->addLanguageLink( $nt->getFullText() ); |
1911 | 1909 | $s = rtrim( $s . $prefix ); |
1912 | 1910 | $s .= trim( $trail, "\n" ) == '' ? '': $prefix . $trail; |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -682,14 +682,15 @@ |
683 | 683 | /** |
684 | 684 | * Get an array of language names, indexed by code. |
685 | 685 | * @param $inLanguage null|string: Code of language in which to return the names |
686 | | - * Use null for autonyms (native names) |
| 686 | + * Use null for autonyms (native names) |
687 | 687 | * @param $include string: |
688 | 688 | * 'all' all available languages |
689 | 689 | * 'mw' only if the language is defined in MediaWiki or wgExtraLanguageNames |
690 | 690 | * 'mwfile' only if the language is in 'mw' *and* has a message file |
691 | 691 | * @return array|bool: language code => language name, false if $include is wrong |
| 692 | + * @since 1.20 |
692 | 693 | */ |
693 | | - public static function fetchLanguageNames( $inLanguage = null, $include = 'all' ) { |
| 694 | + public static function fetchLanguageNames( $inLanguage = null, $include = 'mw' ) { |
694 | 695 | global $wgExtraLanguageNames; |
695 | 696 | static $coreLanguageNames; |
696 | 697 | |
— | — | @@ -743,11 +744,12 @@ |
744 | 745 | /** |
745 | 746 | * @param $code string: The code of the language for which to get the name |
746 | 747 | * @param $inLanguage null|string: Code of language in which to return the name (null for autonyms) |
| 748 | + * @param $include string: 'all', 'mw' or 'mwfile'; see fetchLanguageNames() |
747 | 749 | * @return string: Language name or empty |
748 | 750 | * @since 1.20 |
749 | 751 | */ |
750 | | - public static function fetchLanguageName( $code, $inLanguage = null ) { |
751 | | - $array = self::fetchLanguageNames( $inLanguage, 'all' ); |
| 752 | + public static function fetchLanguageName( $code, $inLanguage = null, $include = 'all' ) { |
| 753 | + $array = self::fetchLanguageNames( $inLanguage, $include ); |
752 | 754 | return !array_key_exists( $code, $array ) ? '' : $array[$code]; |
753 | 755 | } |
754 | 756 | |