* Skip the plural parsing for bytes also when not in miser mode and the message is...
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Tue, 7 Apr 2009 06:47:45 +0000 (06:47 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Tue, 7 Apr 2009 06:47:45 +0000 (06:47 +0000)
includes/ChangesList.php

index 2f8413f..3e34fe4 100644 (file)
@@ -108,11 +108,18 @@ class ChangesList {
        public static function showCharacterDifference( $old, $new ) {
                global $wgRCChangedSizeThreshold, $wgLang, $wgMiserMode;
                $szdiff = $new - $old;
+
+               $code = $wgLang->getCode();
+               static $fastCharDiff = array();
+               if ( !isset($fastCharDiff[$code]) ) {
+                       $fastCharDiff[$code] = $wgMiserMode || wfMsgNoTrans( 'rc-change-size' ) === '$1';
+               }
                        
-               $formatedSize = ( $wgMiserMode? 
-                       $wgLang->formatNum($szdiff) : // avoid expensive calculations
-                       wfMsgExt( 'rc-change-size', array( 'parsemag', 'escape' ), $wgLang->formatNum( $szdiff ) )
-                       );
+               $formatedSize = $wgLang->formatNum($szdiff);
+
+               if ( !$fastCharDiff[$code] ) {
+                       $formatedSize = wfMsgExt( 'rc-change-size', array( 'parsemag', 'escape' ), $formatedSize );
+               }
                        
                if( abs( $szdiff ) > abs( $wgRCChangedSizeThreshold ) ) {
                        $tag = 'strong';