Localisation updates from http://translatewiki.net.
[lhc/web/wiklou.git] / languages / Language.php
index dd2fef6..ef6a367 100644 (file)
@@ -254,7 +254,7 @@ class Language {
         * @since 1.21
         */
        public static function isSupportedLanguage( $code ) {
-               return is_readable( self::getMessagesFileName( $code ) );
+               return $code === strtolower( $code ) && is_readable( self::getMessagesFileName( $code ) );
        }
 
        /**
@@ -3007,6 +3007,18 @@ class Language {
                return $number;
        }
 
+       /**
+        * Front-end for non-commafied formatNum
+        *
+        * @param mixed $number the string to be formatted, should be an integer
+        *        or a floating point number.
+        * @since 1.21
+        * @return string
+        */
+       public function formatNumNoSeparators( $number ) {
+               return $this->formatNum( $number, true );
+       }
+
        /**
         * @param $number string
         * @return string
@@ -3067,7 +3079,7 @@ class Language {
                                if ( $start < 0 ) {
                                        $start = 0;
                                }
-                               $groupedNumber = substr( $number , $start, $end -$start ) . $groupedNumber ;
+                               $groupedNumber = substr( $number, $start, $end -$start ) . $groupedNumber ;
                                $end = $start;
                                if ( $numMatches > 1 ) {
                                        // use the last pattern for the rest of the number
@@ -3520,11 +3532,12 @@ class Language {
                        return '';
                }
 
-               // Handle explicit 0= and 1= forms
+               // Handle explicit n=pluralform cases
                foreach ( $forms as $index => $form ) {
-                       if ( isset( $form[1] ) && $form[1] === '=' ) {
-                               if ( $form[0] === (string) $count ) {
-                                       return substr( $form, 2 );
+                       if ( preg_match( '/\d+=/i', $form ) ) {
+                               $pos = strpos( $form, '=' );
+                               if ( substr( $form, 0, $pos ) === (string) $count ) {
+                                       return substr( $form, $pos + 1 );
                                }
                                unset( $forms[$index] );
                        }