Localisation updates from https://translatewiki.net.
[lhc/web/wiklou.git] / languages / Language.php
index c7871c1..cb2d24f 100644 (file)
@@ -147,7 +147,7 @@ class Language {
 
        /**
         * Cache for language names
-        * @var MapCacheLRU|null
+        * @var HashBagOStuff|null
         */
        static private $languageNameCache;
 
@@ -851,11 +851,11 @@ class Language {
                $cacheKey = $inLanguage === null ? 'null' : $inLanguage;
                $cacheKey .= ":$include";
                if ( self::$languageNameCache === null ) {
-                       self::$languageNameCache = new MapCacheLRU( 20 );
+                       self::$languageNameCache = new HashBagOStuff( array( 'maxKeys' => 20 ) );
                }
-               if ( self::$languageNameCache->has( $cacheKey ) ) {
-                       $ret = self::$languageNameCache->get( $cacheKey );
-               } else {
+
+               $ret = self::$languageNameCache->get( $cacheKey );
+               if ( !$ret ) {
                        $ret = self::fetchLanguageNamesUncached( $inLanguage, $include );
                        self::$languageNameCache->set( $cacheKey, $ret );
                }
@@ -4157,17 +4157,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 +4440,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;
        }
 
        /**