Page MenuHomePhabricator

Statement values are left-aligned for rtl languages on the mobile site
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

Statement values are left-aligned even though the interface is in a rtl language.

Bildschirmfoto_2024-03-24_11-57-49.png (136×392 px, 6 KB)

What should have happened instead?:

Statement values should be right-aligned when the interface is in a rtl language.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

.wikibase-statementview-mainsnak and .wikibase-snakview-value-container both have dir="auto" and the mobile site has extra CSS which causes .wikibase-snakview-value-container to be displayed as an inline element.

The dir attribute isolates the element, i.e. the direction inside the element won't affect anything outside the element, and the direction of anything outside the element won't affect anything inside the element (https://www.w3.org/International/articles/inline-bidi-markup/index.en.html describes how it works).

What seems to be happening:

Setting dir="auto" on .wikibase-snakview-value-container means its content does not affect the direction of its container.
Setting display: inline causes it to only be as wide as its content and positioned in the parent element according to the parent element's direction.

Setting dir="auto" on .wikibase-statementview-mainsnak means its direction is based only on its content.
Its content is directionally isolated.
It can't determine a direction from the parent elements or the child elements, and defaults to ltr.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Q: How the text direction should work in case we have for example an RTL page with Hebrew language, but the statement text is in English (like a URL or a city name)?
Should it be behave like RTL or as a LTR?

image.png (390×495 px, 39 KB)
or
image.png (390×495 px, 39 KB)