wikimedia / mediawiki-gadgets-RTRC

Mirror of https://gerrit.wikimedia.org/g/mediawiki/gadgets/RTRC.
https://meta.wikimedia.org/wiki/RTRC
MIT License
26 stars 11 forks source link

Localize the day number #92

Closed Huji closed 7 months ago

Huji commented 4 years ago

In line 200 we have:

return '<div class="mw-rtrc-heading"><div><strong>' + date.getDate() + ' ' + monthNames[date.getMonth()] + '</strong></div></div>';

The issue is date.getDate() returns the day number in ASCII characters (e.g. 8) but some languages (e.g. Persian, Hindi, etc.) use other numerals.

mw.language.convertNumber(date.getDate()) would fix it, assuming a dependency to mw.language is acceptable.

Krinkle commented 3 years ago

Sounds good to me! We could also adopt the january-date, february-date, etc messages while at it, so that we don't have to assume the preferred order of the number and the month name.

Krinkle commented 7 months ago

Exported to https://phabricator.wikimedia.org/T361301.