* {{PLURAL:}} now handles formatted numbers correctly
This commit is contained in:
parent
0137e65890
commit
c3b2f94cb9
3 changed files with 13 additions and 0 deletions
|
|
@ -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 ==
|
||||
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue