Page MenuHomePhabricator

DateTimeInputWidget is backwards in right-to-left languages
Closed, DuplicatePublic

Description

The OOUI time widget is backwards in right-to-left languages. Even though these languages' letters and words are written from left to right, the time in them is mostly (see below) written from right to left, just like in English. For example, here you can see a screenshot of the event end time input form for the CampaignEvents extension in Hebrew:

Screenshot 2022-08-16 at 11-46-56 עריכת הרשמה לאירוע – Meta.png (72×356 px, 4 KB)

The time is displayed as "01:39:08", but it's supposed to be "08:39:01"!

The only RTL languages that actually shows time (and numbers in general) from right to left is N'Ko (code nqo). So "16:35" is shown as "16:35" in both English and Hebrew, but in N'Ko it would be shown as "53:61". (It also has its own digits, so it would actually be "߁߆‎:߃߅", but digit conversion is a separate task.)

The easy solution for this is probably to group the <span>s for hours, minutes, and seconds in a span and force dir="ltr" on this span in all languages except nqo, which would have dir="rtl".

(Tagging CampaignEvents because that's where I saw it, and also because I heard that CampaignEvents developers may be doing some updates to that widget. But if it's out of place, feel free to remove that tag.)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Yes, they can be merged, but the exception for N'Ko should be mentioned.

matmarex subscribed.

This is mw.widgets.datetime.DateTimeInputWidget, which is not a part of OOUI.

matmarex renamed this task from OOUI time widget is backwards in right-to-left languages to DateTimeInputWidget is backwards in right-to-left languages.Aug 16 2022, 8:22 PM