Page MenuHomePhabricator

Passing minus sign (x2215) to the magicword formatnum blanks pages on Malayalam WIkipedia
Open, LowPublic

Description

The formatnum magicword works differently in ml and en wikipedia.

Please see a page in english wikipedia using {{formatnum:−5}}. Please note that the minus sign used here is x2215

http://en.wikipedia.org/w/index.php?title=User:Vssun/sandbox&oldid=514823050

The same function at ml.wikipedia make the entire page blank

http://ml.wikipedia.org/w/index.php?title=%E0%B4%89%E0%B4%AA%E0%B4%AF%E0%B5%8B%E0%B4%95%E0%B5%8D%E0%B4%A4%E0%B4%BE%E0%B4%B5%E0%B5%8D%3AVssun%2Ftest&diff=1429603&oldid=1429602

Changing the minus sign to - (x002D), solves the problem.

http://ml.wikipedia.org/w/index.php?title=%E0%B4%89%E0%B4%AA%E0%B4%AF%E0%B5%8B%E0%B4%95%E0%B5%8D%E0%B4%A4%E0%B4%BE%E0%B4%B5%E0%B5%8D:Vssun/test&diff=next&oldid=1429603

Please correct it in ml.wikipedia to use the formatnum function with both styles of minus sign.


Version: wmf-deployment
Severity: normal

Details

Reference
bz40587

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:47 AM
bzimport set Reference to bz40587.
bzimport added a subscriber: Unknown Object (MLST).

razimantv wrote:

The behavior of formatnum when there are non-numeric characters passed as argument is in general very different between English and Malayalam.

For example, on trying {{formatnum:x 4200 x}}, the results are:
On enwiki : x 4,200 x
On mlwiki : x, 42

Except for where the commas are placed within numbers (4,20,000 as opposed to 420,000), there shouldn't ideally be any difference between the behavior of formatnum on en and ml.

Although my interface language in commons is Malayalam, formatnum gives 3,3,3.. grouping there ([[:commons:User:Praveenp/test]]). Per bug 29495 it should be 3,2,2... . Without non-numeric characters formatnum gives correct grouping in ml.wp.

This is something related to Indian style number grouping feature included in r97793 (Bug 29495). Once I removed $digitGroupingPattern = ",,###"; from /languages/messages/MessagesMl.php in my local wiki, bug disappears. So cc'ing Santhosh Thottingal.

I checked languages hi and ta also and both suffer same problem. Indian style number grouping pattern was added to ml, hi, pa, gu, or, bn, as, te, ta, kn, mr so this bug may affect all these languages.

{{formatnum}} is not general number formatting magic word, but mostly intended to be used in interface messages. This is the reason why it gives invalid output when you give it invalid input.

Also, the output of {{formatnum}} in page content does not vary according to the users interface language, that is the intended behavior.

If I understand correctly, "−" (x2215) is handled in parser functions already. I saw it assigned to "-" in function doExpression() in /parserfuctions/Expr.php

Pppery subscribed.
This comment was removed by Pppery.