From: Niklas Laxström Date: Tue, 7 Apr 2009 06:47:45 +0000 (+0000) Subject: * Skip the plural parsing for bytes also when not in miser mode and the message is... X-Git-Tag: 1.31.0-rc.0~42204 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/fiche.php?a=commitdiff_plain;h=eb1c7640db1670c9a5d8cf0f2da4f2b1d3816064;p=lhc%2Fweb%2Fwiklou.git * Skip the plural parsing for bytes also when not in miser mode and the message is not customised --- diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 2f8413f78c..3e34fe40c8 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -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';