Page MenuHomePhabricator

Discussion tool uses content language direction for UI
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

  1. Go to https://ar.wikipedia.beta.wmflabs.org/wiki/%D9%86%D9%82%D8%A7%D8%B4_%D8%A7%D9%84%D9%85%D8%B3%D8%AA%D8%AE%D8%AF%D9%85%D8%A9:Whatamidoing_(WMF)?uselang=en&dtvisual=1
  2. Click the "Reply" button
  3. Switch to visual mode
  4. See the problem in the upper left:

Screen Shot 2020-05-20 at 11.49.27 AM.png (640×1 px, 92 KB)

Event Timeline

We should set dir="ltr" / dir="rtl" on the widget depending on the user language direction – it's inserted in the middle of the page content, so it currently uses content language direction. That seems to fix the visual issues.

I am not sure if we should also set it on the actual editing area depending on the content language direction again? I guess technically whatever you write there will be then inserted into the page and use content directionality, but in practice if you're using 'uselang=en' then you're probably typing in English, and will be annoyed by parentheses etc. being in the wrong direction.

We should always use content language/dir for the editor surface (we do), and the interface language for the toolbar and other controls (we don't yet).

In the case you are actually writing a message in the "wrong" language and want to change the content direction while composing there is a tool for that in VE (ctrl+shift+x).

Esanders renamed this task from Visual mode has RTL/LTR language problems to Discussion tool uses content language for UI.May 20 2020, 9:33 PM

Change 597636 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/DiscussionTools@master] ReplyWidget: Use interface dir for UI

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

Change 597636 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] ReplyWidget: Use interface dir for UI

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

nl wiki is still showing the menu options in English, other than that, the direction and the language look okay for other target wikis.

Screen Shot 2020-05-28 at 3.37.32 PM.png (557×1 px, 172 KB)

Sorry, I should've titled this "content language direction". If you have uselang=en, the interface should be in English, but that shouldn't break the layout of the reply widget on RTL wikis.

Esanders renamed this task from Discussion tool uses content language for UI to Discussion tool uses content language direction for UI.May 29 2020, 11:49 AM

Here is the new behaviour on Arabic wiki with interface language set to English:

image.png (419×701 px, 61 KB)

Green areas are content and therefore RTL, blue areas are interface and therefore LTR.

Here is the new behaviour on Arabic wiki with interface language set to English:

image.png (419×701 px, 61 KB)

Green areas are content and therefore RTL, blue areas are interface and therefore LTR.

Understood, thanks @Esanders!

ppelberg claimed this task.