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.
Description
Details
Related Objects
Event Timeline
@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.
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
Change 228618 had a related patch set uploaded (by Legoktm):
Set an explicit 'wgLanguageCode' entry for metawiki
Change 228617 abandoned by Legoktm:
[mediawiki/extensions/GlobalUserPage@master] Use 'PageContentLanguage' hook to set proper lang & div attributes
Reason:
Outdated, not working on it
Change 908001 had a related patch set uploaded (by BrandonXLF; author: BrandonXLF):
[mediawiki/extensions/GlobalUserPage@master] Set correct lang and dir for parser output
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)