* {{PLURAL:}} now handles formatted numbers correctly

This commit is contained in:
Niklas Laxström 2006-12-23 18:58:44 +00:00
parent 0137e65890
commit c3b2f94cb9
3 changed files with 13 additions and 0 deletions

View file

@ -397,6 +397,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
option to prevent this when running maintennace/update.php
* (bug 7612) Remove superfluous link to Special:Categories from result items
on Special:Mostcategories
* {{PLURAL:}} now handles formatted numbers correctly
== Languages updated ==

View file

@ -93,6 +93,7 @@ class CoreParserFunctions {
}
static function plural( $parser, $text = '', $arg0 = null, $arg1 = null, $arg2 = null, $arg3 = null, $arg4 = null ) {
$text = $parser->getFunctionLang()->parseFormattedNumber( $text );
return $parser->getFunctionLang()->convertPlural( $text, $arg0, $arg1, $arg2, $arg3, $arg4 );
}

View file

@ -1166,6 +1166,17 @@ class Language {
return $number;
}
function parseFormattedNumber( $number ) {
$s = $this->digitTransformTable();
if (!is_null($s)) { $number = strtr($number, array_flip($s)); }
$s = $this->separatorTransformTable();
if (!is_null($s)) { $number = strtr($number, array_flip($s)); }
$number = strtr( $number, array (',' => '') );
return $number;
}
/**
* Adds commas to a given number
*