Page MenuHomePhabricator

Wrong sorting in tables with {{formatnum}} in Spanish Wikipedia (es.wp) due to spaces to separate thousands
Closed, ResolvedPublic

Description

After the implementation of the spaces to separate thousands with {{formatnum:}}, sortable tables do not work well with them.

You can test an example in http://es.wikipedia.org/wiki/Usuario:Invadinado/testing-tables

Thanks in advance.


Version: 1.21.x
Severity: major
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=43165

Details

Reference
bz42924

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 1:02 AM
bzimport added a project: MediaWiki-JavaScript.
bzimport set Reference to bz42924.
bzimport added a subscriber: Unknown Object (MLST).
abian created this task.Dec 10 2012, 9:28 PM

$.tablesorter doesn't consider space a valid number separator, and it's not included in the regex for detecting numbers that's built on line 391 of resources/jquery/jquery.tablesorter.

I'm not sure if we can just include it there, or if it's going to cause some breakage.

Actually, it seems like it is, coming from wgSeparatorTransformTable. I'd have to look into it more to figure out what's happening.

The vars are correct:
"wgSeparatorTransformTable":[", ."," ,"]
"wgDigitTransformTable":["",""]
And tablesort splits by the \t

Looks like the regex get confused by the space and only getting the first block as number.

  • Bug 56952 has been marked as a duplicate of this bug. ***

The example given in the description works for me: sorting by any of both columns give me the same results.

Has it been resolved?

abian closed this task as Resolved.Dec 22 2014, 1:39 PM
abian claimed this task.

Resolved. Thanks.

Krinkle removed a subscriber: Krinkle.Jan 8 2015, 8:57 PM