Page MenuHomePhabricator

RTL languages in glosses should be aligned to right
Closed, ResolvedPublic2 Estimated Story Points


RTL language Glosses (like Hebrew) are not aligned to the right side like RTL languages should be.



he_rtl.png (984×1 px, 150 KB)

Acceptance criteria:

  • Gloss directionality is marked-up per gloss language


Possible solutions

  • apply dir attribute to the parent block element (in this case td) if possible.
  • instead of span, we can use a block element that supports dir attribute, such as p or div.
  • change the display style of the span element containing the gloss value to block

Event Timeline

More precisely, every gloss must have correct lang and dir HTML attributes, whether it's RTL or LTR. Correct alignment should come with it automatically, and fixed by hand only if necessary.

We already set the correct lang and dir attributes server-side (though I don’t know if we also do it when rebuilding the UI in JavaScript after editing), but apparently that’s not enough. As I wrote in T202618: Glosses of sense are not aligned correctly, setting display: block on the <span> surrounding the text appears to have the desired effect, but I’m not sure if that’s the best solution.

Note: display: inline-block correctly aligns multi-line glosses, but doesn’t move single-line glosses all the way to the right of the surrounding table. I think we want display: block.

Screenshot_2019-04-16 beryl.png (68×563 px, 7 KB)

Change 504517 had a related patch set uploaded (by Rosalie Perside (WMDE); owner: Rosalie Perside (WMDE)):
[mediawiki/extensions/WikibaseLexeme@master] RTL languages in glosses should be aligned to right

Change 504517 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] RTL languages in glosses should be aligned to right