Page MenuHomePhabricator

Improve RTL support in Community Wishlist
Closed, ResolvedPublic

Description

User Story

As a user who views the wishlist in an RTL language, the directionality of the content should always match that of my language.

Engineering details

Some pages like Template:Community Wishlist/Wishes use TemplateStyles. TemplateStyles can only be applied to parser output. As such, we can't use i.e. [dir='rtl'] .some-selector because the only elements with [dir='rtl'] are outside the .mw-parser-output.

To get around this, we can use the {{int:lang}] hack in conjunction with Template:Dir. As it turns out, the {{int:lang}} thing is a manually built system on Meta, Commons and other wikis (see list of lang pages). We will implement the same hack on our staging wiki, and have the Wishlist Intake setup task set this up automatically. However, in order to do so, we need a grant available in Core that has the pagelang permission so that the action=setpagelanguage can be used through bot passwords.

Acceptance criteria

  • Any left/right styling should be flipped, for example:
    • The checkboxes in the Projects section of the intake form.
    • The padding around the chevrons in table headers (T368367)
  • npm run setup should automate setting up the {{int:lang}} hack

Details for QA

  • Please be advised that on staging, the only languages currently supported (for the purposes of RTL/LTR testing) are en, en-rtl, ar, de, and es.
  • Also note table sorting does not work for en-rtl, which is expected.

Details

Other Assignee
dom_walden
TitleReferenceAuthorSource BranchDest Branch
DeployCommand: don't error out for unchanged MediaWiki:Lang pagesrepos/commtech/wishlist-intake!118musikanimalint-lang-follow-upmain
Add $wgPageLanguageUseDB = truetoolforge-repos/wishlist-test!3samwilsonpagelangmaster
Improve RTL support; add automation to install {{int:lang}} systemrepos/commtech/wishlist-intake!111musikanimalrtlmain
Customize query in GitLab

Event Timeline

Change #1050038 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/core@master] MainConfigSchema: add 'pagelang' as a permission for 'editpage'

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

Change #1050038 merged by jenkins-bot:

[mediawiki/core@master] MainConfigSchema: add 'pagelang' as a permission for 'editpage'

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

Samwilson subscribed.

This is all merged and deployed on the test site now, and ready for QA.

dom_walden subscribed.

I have translated as much of https://wishlist-test.toolforge.org as I can into Arabic, both through translating MediaWiki namespace messages and content translations.

I changed my user language to Arabic and used many of the wishlist features and pages. I could not find any RTL problems (as far as I could tell given that I don't speak Arabic).

For many of the pages, I did have to change the URL to add /ar. (e.g. https://wishlist-test.toolforge.org/wiki/Community_Wishlist/ar, https://wishlist-test.toolforge.org/wiki/Community_Wishlist/Wishes/ar, https://wishlist-test.toolforge.org/wiki/Community_Wishlist/Wishes/Translate_Wish_4/ar). I think this is just how content translation works normally.