Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384026 )

Change subject: Parse: Disable commafy for magicvar values for month, days
......................................................................

Parse: Disable commafy for magicvar values for month, days

In Parser#getVariableValue For the following Magic variable identifiers
Language#formatNum was called without any commafy argument.

currentmonth, currentmonth1, currentday, currentday2, localmonth,
localmonth1, localday, localday2

The default value for formatNum nocommafy is false, meaning formatNum
will do commafication. For the above context, it is commafy process
is not needed since the passed values are often month values like
02, 03 etc. Commafy is noop on this values.

Explicitly pass false value for formatNum's nocommafy argument.
Language#formatNum method documentation for nocommafy also recommends
setting it true in case of dates.

Change-Id: I3233d5458af8cef583e5d1d599d9408542ba08c9
---
M includes/parser/Parser.php
1 file changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/26/384026/1

diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 49f2ce1..f2e47dc 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -2504,10 +2504,10 @@
                                $value = '|';
                                break;
                        case 'currentmonth':
-                               $value = $pageLang->formatNum( 
MWTimestamp::getInstance( $ts )->format( 'm' ) );
+                               $value = $pageLang->formatNum( 
MWTimestamp::getInstance( $ts )->format( 'm' ), true );
                                break;
                        case 'currentmonth1':
-                               $value = $pageLang->formatNum( 
MWTimestamp::getInstance( $ts )->format( 'n' ) );
+                               $value = $pageLang->formatNum( 
MWTimestamp::getInstance( $ts )->format( 'n' ), true );
                                break;
                        case 'currentmonthname':
                                $value = $pageLang->getMonthName( 
MWTimestamp::getInstance( $ts )->format( 'n' ) );
@@ -2519,16 +2519,16 @@
                                $value = $pageLang->getMonthAbbreviation( 
MWTimestamp::getInstance( $ts )->format( 'n' ) );
                                break;
                        case 'currentday':
-                               $value = $pageLang->formatNum( 
MWTimestamp::getInstance( $ts )->format( 'j' ) );
+                               $value = $pageLang->formatNum( 
MWTimestamp::getInstance( $ts )->format( 'j' ), true );
                                break;
                        case 'currentday2':
-                               $value = $pageLang->formatNum( 
MWTimestamp::getInstance( $ts )->format( 'd' ) );
+                               $value = $pageLang->formatNum( 
MWTimestamp::getInstance( $ts )->format( 'd' ), true );
                                break;
                        case 'localmonth':
-                               $value = $pageLang->formatNum( 
MWTimestamp::getLocalInstance( $ts )->format( 'm' ) );
+                               $value = $pageLang->formatNum( 
MWTimestamp::getLocalInstance( $ts )->format( 'm' ), true );
                                break;
                        case 'localmonth1':
-                               $value = $pageLang->formatNum( 
MWTimestamp::getLocalInstance( $ts )->format( 'n' ) );
+                               $value = $pageLang->formatNum( 
MWTimestamp::getLocalInstance( $ts )->format( 'n' ), true );
                                break;
                        case 'localmonthname':
                                $value = $pageLang->getMonthName( 
MWTimestamp::getLocalInstance( $ts )->format( 'n' ) );
@@ -2540,10 +2540,10 @@
                                $value = $pageLang->getMonthAbbreviation( 
MWTimestamp::getLocalInstance( $ts )->format( 'n' ) );
                                break;
                        case 'localday':
-                               $value = $pageLang->formatNum( 
MWTimestamp::getLocalInstance( $ts )->format( 'j' ) );
+                               $value = $pageLang->formatNum( 
MWTimestamp::getLocalInstance( $ts )->format( 'j' ), true );
                                break;
                        case 'localday2':
-                               $value = $pageLang->formatNum( 
MWTimestamp::getLocalInstance( $ts )->format( 'd' ) );
+                               $value = $pageLang->formatNum( 
MWTimestamp::getLocalInstance( $ts )->format( 'd' ), true );
                                break;
                        case 'pagename':
                                $value = wfEscapeWikiText( 
$this->mTitle->getText() );

-- 
To view, visit https://gerrit.wikimedia.org/r/384026
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3233d5458af8cef583e5d1d599d9408542ba08c9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to