Page MenuHomePhabricator

[minor] fawiki - SE counter displays Arabic numerals before switching to Farsi numerals
Closed, ResolvedPublic

Description

The issue exists on fawiki and bnwiki (production and betalabs).

  1. Go to Special:Homepage.
  2. When the page loads, the Arabic numerals will be displayed before switching to the wiki correct numerals.

fa_SE_arabic_numerals2.gif (620×633 px, 115 KB)

Event Timeline

Restricted Application added subscribers: Huji, alaa, Aklapper. · View Herald Transcript
Etonkovidova renamed this task from [minor] fawiki - SE counter displays Arabic numerals before switching to Farsi numberals to [minor] fawiki - SE counter displays Arabic numerals before switching to Farsi numerals.Feb 11 2021, 1:16 AM

Like the other tasks linked, the solution is to use mw.language.convertNumber() before outputting the number, and also to ensure that mediawiki.language is defined as a resource loader dependency for the relevant module in extension.json.

Change 663683 had a related patch set uploaded (by Mepps; owner: Mepps):
[mediawiki/extensions/GrowthExperiments@master] WIP: Needs testing but this is my guess for translating the initial number in suggestededits

https://gerrit.wikimedia.org/r/663683

Hmm, just saw the feedback on the patch. It makes sense now that I look more closely. It looks like the number actually gets set earlier in the code.

Okay, I just pushed an updated patch. I'd love advice for testing it, but I'm pretty sure this is it.

Okay, I just pushed an updated patch. I'd love advice for testing it, but I'm pretty sure this is it.

Yep, that patch looks correct. For testing, you can append ?uselang={langCode} when viewing the homepage, e.g. http://localhost:8080/w/index.php?title=Special:Homepage&source=personaltoolslink&namespace=8&uselang=fa. If you want, you can disable JavaScript in your browser so it's easier to inspect the server-side rendered content before the JavaScript would otherwise kick in.

Thanks @kostajh! I can confirm that I see the bug without the patch, and do not see the behavior with the patch applied.

@kostajh I have updated the patch with the changes you suggested.

Change 663683 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] Use numParams for numerical message params in SuggestedEdits

https://gerrit.wikimedia.org/r/663683

Checked in betalabs - looks great. Added to the list of post-deployment checking.

  NODES
Experiments 4
HOME 4
Javascript 2
Note 3
os 13
server 1