Page MenuHomePhabricator

Global user pages must have the direction of the global wiki
Closed, ResolvedPublic

Description

My Meta user page, in English, is adjusted RTL when shown on ar.wikipedia.org. See: https://meta.wikimedia.org/wiki/User:Wikiklaas and https://ar.wikipedia.org/wiki/%D9%85%D8%B3%D8%AA%D8%AE%D8%AF%D9%85:Wikiklaas
I guess English language pages should be adjusted LTR, also on projects that have RTL adjustification. Adding a div with textdir=ltr language=en did not help.

Event Timeline

Wikiklaas raised the priority of this task from to Needs Triage.
Wikiklaas updated the task description. (Show Details)
Wikiklaas added a project: GlobalUserPage.
Wikiklaas subscribed.
Amire80 subscribed.

@Wikiklaas, if I look at your user page at the Arabic Wikipedia now, it appears correctly. Are you sure that it's still a problem?

... That said, it's because of the HTML you added. The extension should add this HTML automatically. If I look at my user page at the Yiddish Wikisource, it's broken - it is RTL, but should be LTR.

Yes, and that's what @Wikiklaas did, more or less, but it should be automatic.

To make sure I understand this bug properly, the extension should automatically add <div lang="en" dir="ltr" class="mw-content-ltr"> (and the closing div tag)?

Kind of, but more precisely:

  • lang must be the page language (getPageLanguage(); in practice equal to the wiki's content language, but this may change in the future)
  • dir must be the dir of that language (getDir())
  • class must match the dir

For the case of Wikimedia, it's Meta, and it's en and rtl, but for other installations it may be different.

Thanks for your comments. As you say this should be done automatically, I removed the div for the text-direction. I did now get a Flash Of Unstyled Content, showing the text ltr, but then the rtl Arabic css took over.

Change 228617 had a related patch set uploaded (by Legoktm):
Use 'PageContentLanguage' hook to set proper lang & div attributes

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

Change 228618 had a related patch set uploaded (by Legoktm):
Set an explicit 'wgLanguageCode' entry for metawiki

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

Amire80 renamed this task from LTR pages adjusted RTL on arabic languages to Global user pages must have the direction of the global wiki.Feb 28 2018, 12:29 PM

Change 228617 abandoned by Legoktm:

[mediawiki/extensions/GlobalUserPage@master] Use 'PageContentLanguage' hook to set proper lang & div attributes

Reason:

Outdated, not working on it

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

Change 908001 had a related patch set uploaded (by BrandonXLF; author: BrandonXLF):

[mediawiki/extensions/GlobalUserPage@master] Set correct lang and dir for parser output

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

Krinkle claimed this task.
Krinkle subscribed.

These two examples seem to work correctly today:

By "correct" I mean, that, they render with dir=ltr lang=en and, specifically, do so while viewing the page on an RTL wiki with a non-English user interface language (i.e. logged-out, or with ?uselang=he). If I misunderstood the issue or if it's still broken for you, feel free to re-open.

Change 908001 abandoned by BrandonXLF:

[mediawiki/extensions/GlobalUserPage@master] Set correct lang and dir for parser output

Reason:

Parse now handles lang and dir (https://gerrit.wikimedia.org/r/c/mediawiki/core/+/939783)

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