Special:Version: Use addModuleStyles to load mediawiki.special.version
[lhc/web/wiklou.git] / languages / Language.php
index 7747198..42c5a57 100644 (file)
@@ -383,20 +383,13 @@ class Language {
         * @return bool
         */
        public static function isKnownLanguageTag( $tag ) {
-               static $coreLanguageNames;
-
                // Quick escape for invalid input to avoid exceptions down the line
                // when code tries to process tags which are not valid at all.
                if ( !self::isValidBuiltInCode( $tag ) ) {
                        return false;
                }
 
-               if ( $coreLanguageNames === null ) {
-                       global $IP;
-                       include "$IP/languages/Names.php";
-               }
-
-               if ( isset( $coreLanguageNames[$tag] )
+               if ( isset( MediaWiki\Languages\Data\Names::$names[$tag] )
                        || self::fetchLanguageName( $tag, $tag ) !== ''
                ) {
                        return true;
@@ -874,12 +867,6 @@ class Language {
         */
        private static function fetchLanguageNamesUncached( $inLanguage = null, $include = 'mw' ) {
                global $wgExtraLanguageNames;
-               static $coreLanguageNames;
-
-               if ( $coreLanguageNames === null ) {
-                       global $IP;
-                       include "$IP/languages/Names.php";
-               }
 
                // If passed an invalid language code to use, fallback to en
                if ( $inLanguage !== null && !Language::isValidCode( $inLanguage ) ) {
@@ -893,7 +880,7 @@ class Language {
                        Hooks::run( 'LanguageGetTranslatedLanguageNames', array( &$names, $inLanguage ) );
                }
 
-               $mwNames = $wgExtraLanguageNames + $coreLanguageNames;
+               $mwNames = $wgExtraLanguageNames + MediaWiki\Languages\Data\Names::$names;
                foreach ( $mwNames as $mwCode => $mwName ) {
                        # - Prefer own MediaWiki native name when not using the hook
                        # - For other names just add if not added through the hook
@@ -4157,17 +4144,6 @@ class Language {
                return (bool)$this->mConverter->validateVariant( $variant );
        }
 
-       /**
-        * Put custom tags (e.g. -{ }-) around math to prevent conversion
-        *
-        * @param string $text
-        * @return string
-        * @deprecated since 1.22 is no longer used
-        */
-       public function armourMath( $text ) {
-               return $this->mConverter->armourMath( $text );
-       }
-
        /**
         * Perform output conversion on a string, and encode for safe HTML output.
         * @param string $text Text to be converted
@@ -4451,12 +4427,11 @@ class Language {
         * @return bool|string
         */
        public static function getFallbackFor( $code ) {
-               if ( $code === 'en' || !Language::isValidBuiltInCode( $code ) ) {
-                       return false;
-               } else {
-                       $fallbacks = self::getFallbacksFor( $code );
+               $fallbacks = self::getFallbacksFor( $code );
+               if ( $fallbacks ) {
                        return $fallbacks[0];
                }
+               return false;
        }
 
        /**