Page MenuHomePhabricator

Incorrect number formatting of Lua memory usage in languages with comma
Closed, ResolvedPublic

Description

The formatting of "Lua memory usage" is incorrect for values above 1 MB (1024 kB).

See example in this screenshot.

A value of "3.04 MB" should be formatted/presented as "3,04 Mbyte" but it is presented as "3 04 Mbyte", i.e. there is a space where there should be a decimal comma sign.

Wikipedia version: 1.32.0-wmf.8 (rMW53a4a6c2204e) 15 juni 2018 kl. 00.14

Event Timeline

Nirmos subscribed.

The relevant messages here are scribunto-limitreport-memusage-value-html and size-megabytes.

What seems to be going on here is that Scribunto passes the size through Language::formatSize(), resulting in "3,04 MB" using comma as the decimal separator, and the MediaWiki passes it through Language::formatNum() again which interprets the comma as a thousands separator and turns it into a space.

This seems to have been caused by rMW2c3f2dd61cdf: Numbers in the parser profiling data are not internationalized when attempting to fix T158607: Numbers in the parser profiling data are not internationalized.

Vvjjkkii renamed this task from Incorrect formatting of "Lua - minnesanvändning" ("Lua memory usage") in Parser Profiling Data in Swedish Wikipedia to kuaaaaaaaa.Jul 1 2018, 1:03 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: Huji, Aklapper.
CommunityTechBot renamed this task from kuaaaaaaaa to Incorrect formatting of "Lua - minnesanvändning" ("Lua memory usage") in Parser Profiling Data in Swedish Wikipedia.Jul 2 2018, 5:04 AM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: Huji, Aklapper.
stjn renamed this task from Incorrect formatting of "Lua - minnesanvändning" ("Lua memory usage") in Parser Profiling Data in Swedish Wikipedia to Incorrect number formatting of Lua memory usage in languages with comma.Oct 26 2018, 4:07 PM
stjn subscribed.

Changed the title of this task since the problem does not concern only Swedish Wikipedia (and maybe this way it will be more searchable for others). This bugged me for a long time in Russian (and I couldn’t really find where this comes from), good job on reporting this :-)

So, may ScribuntoHooks::formatLimitData hook be safely removed? or should it be hooked elsewhere than to ParserLimitReportFormat?

Krinkle subscribed.

Untagging Parser and Debug-Logger, as it does not appear to be an issue with the parsing of wikitext, nor an issue with PSR-3, Monolog or MWExceptionHandler etc

matej_suchanek assigned this task to cscott.
matej_suchanek subscribed.

This was probably fixed within efforts in T263592.

See example in this screenshot.

Please submit screenshots directly to Phabricator to avoid relying on third-party services.