Page MenuHomePhabricator

Numerical values are not localized
Closed, ResolvedPublic


None of the number representations are localized, for instance in Persian digits, which should map to ۰ ۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹

From the Alfa80, who reported this:

In tabular format it does not bother to see the numbers in the different localization, however inline mixture such as "+3 hours" or "ساعت +3" in conjunction with the RTL direction of language would be improved greatly if numbers were localized.

Event Timeline

MusikAnimal moved this task from Backlog to Other on the XTools board.Feb 5 2018, 6:48 PM
MusikAnimal added subscribers: Epine, OldUser02.

From T189248:

Our project is written from right to left therefore we have inverted commas (،) and our own numerical system which is not like the English version (numbers from 0 to 9: ٠١٢٣٤٥٦٧٨٩) even though XTools is almost completely translated to Kurdish, the commas and numbers still remain the same. This issue is nonexistent on the ckb Wikipedia as they have all been modified previously when the site was created. A similar thing needs to be done on XTools.

Epine added a comment.Mar 8 2018, 11:47 PM

@MusikAnimal thanks for the merge. When will it be fixed?

MusikAnimal added a comment.EditedMar 8 2018, 11:48 PM

I'll try to get on this soon. I'm not sure about the best approach implementation-wise, is the biggest problem. It won't be trivial, but we'll make it happen :)

Epine added a comment.Mar 9 2018, 12:41 AM

@MusikAnimal I hope you noticed that the Kurdish numbers aren't the same as the persian numbers.

@MusikAnimal I hope you noticed that the Kurdish numbers aren't the same as the persian numbers.

Hehe yes for sure :) This ticket is about localizing for everyone. I might end up having to import MediaWiki's translations, not sure. I'll keep you updated on progress. Thanks again.

MusikAnimal moved this task from Other to Working on the XTools board.
MusikAnimal closed this task as Resolved.Mar 13 2018, 3:41 PM
MusikAnimal moved this task from Working to Complete on the XTools board.

So it turns out I was using the proper PHP NumberFormatter class, but wasn't actually outputting the formatted number! So, problem solved for Persian, and several other languages that lacked support up until now.

Unfortunately, it seems Kurdish is not well-supported by these libraries. I even tried using JavaScript with Number.prototype.toLocaleString(), but alas Kurdish is not supported there either! I asked the MediaWiki internationalization folks for help, and apparently they have some in-house solution, which is why you see numerical localization at This is not available to third-party applications at this time, but they hope to make it available some day. Come to find out, MediaWiki's multilingual support is far greater than most of the web!

@Epine So, I'm sorry to say Kurdish numerical localization is still unsupported :( It's possible we could manually localize via translations for each number, but that would take considerable time to implement, and would be prone to error.

However with recent improvements, the interface in RTL languages has been greatly improved, so hopefully that at least is a welcomed change :)

Epine added a comment.Mar 13 2018, 4:14 PM

@MusikAnimal aww :( that's disappointing. Could you at least try what you just mentioned please? Even if it didn't work (who knows, it actually might). I'm not a programmer but I'm willing to help with any translations, we actually have a programmer at CKB, if you needed you can contact him: User: Muhammed taha

I think it might be easier/better to fix this upstream in the i18n libraries. I'll see what I can do.

Epine added a comment.Mar 13 2018, 9:37 PM

@MusikAnimal thank you for trying!

Epine added a comment.Jul 28 2018, 9:43 AM

@MusikAnimal could you please try ar numericals instead of Kurdish? From my understanding they use the same numericals we use in most Arabic regions as well. But the Arabic Wikipedia uses same numericals as the English Wikipedia, so if that’s the case then that’s not really an option either.