Page MenuHomePhabricator

Right to left text is aligned left to right in table
Closed, ResolvedPublic3 Estimated Story Points

Description

As someone who reads an RTL language, I want to read the respective rows (e.g. hebrew) right-aligned in order to not be confused.

Problem:
Hebrew labels, descriptions and aliases are currently not right-aligned, but they should be.

Example:
https://wikidata-shex.wmflabs.org/wiki/Schema:O9

Acceptance criteria:

  • Hebrew and other RTL languages are right-aligned in the table.

Event Timeline

dir="auto" on the individual table cells seems to fix it.

Also, the whole table should go right-to-left in RTL languages (with “edit” links on the left). dir="auto" on the whole table seems to fix that, too.

Change 498929 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/WikibaseSchema@master] Align table rows language-dependent

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

Also, the whole table should go right-to-left in RTL languages (with “edit” links on the left). dir="auto" on the whole table seems to fix that, too.

That doesn't seem to work for me. Part of the reason seems to be that the content-language is always set to en and direction is always ltr:

<div id="mw-content-text" dir="ltr" class="mw-content-ltr" lang="en">

Change 499176 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/WikibaseSchema@master] Ensure Schema content language follows ui language

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

Also, the whole table should go right-to-left in RTL languages (with “edit” links on the left). dir="auto" on the whole table seems to fix that, too.

That doesn't seem to work for me. Part of the reason seems to be that the content-language is always set to en and direction is always ltr:

<div id="mw-content-text" dir="ltr" class="mw-content-ltr" lang="en">

I think we might be referring to different things? On my system, dir="auto" on the <table> makes the table columns go right-to-left, with the “edit” link on the left. But the whole table is still left-aligned on the page due to the content language – is that what you meant?

I think we might be referring to different things? On my system, dir="auto" on the <table> makes the table columns go right-to-left, with the “edit” link on the left. But the whole table is still left-aligned on the page due to the content language – is that what you meant?

Setting the dir="auto" attribute on the <table> tag on https://wikidata-shex.wmflabs.org/wiki/Schema:O2?setlang=he doesn't change anything for me. Which feels plausible, since the lang attribute on the parent element is still en?

Change 498929 merged by jenkins-bot:
[mediawiki/extensions/WikibaseSchema@master] Align table rows language-dependent

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

Oh, I know why – use uselang=ar, not he. The table headings aren’t translated yet into Hebrew.

Change 499176 merged by jenkins-bot:
[mediawiki/extensions/WikibaseSchema@master] Ensure Schema content language follows ui language

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