Page MenuHomePhabricator

[MEX] M5 - Statement values are left-aligned for rtl languages on the mobile site
Closed, ResolvedPublicBUG 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 (392×136 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.

Task Time May 26:
A/C

  • RTL alignment is right aligned on wbui2025

-

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 (495×390 px, 39 KB)
or
image.png (495×390 px, 39 KB)

If the UI is in a RTL language it should be right aligned to match the rest of the page

Arian_Bozorg renamed this task from Statement values are left-aligned for rtl languages on the mobile site to {MEX] M5 - Statement values are left-aligned for rtl languages on the mobile site.May 22 2026, 12:13 PM
Arian_Bozorg edited projects, added: Wikidata-Omega; removed: Wikidata-Omega (Triaging).
Arian_Bozorg renamed this task from {MEX] M5 - Statement values are left-aligned for rtl languages on the mobile site to [MEX] M5 - Statement values are left-aligned for rtl languages on the mobile site.May 26 2026, 8:20 AM

I think the bug in wbui2025 comes from this CSS in snakValue.less

	[ dir='rtl' ] & {
		mask-image: linear-gradient( to right, transparent 0, @color-emphasized 3em );
		direction: rtl;
	}

which gets CSSJanus’ed into direction: ltr; – the exact opposite of what we want. I suspect we need to either remove this line altogether or mark it as @noflip.

Adding a screenshot of the issue in the new UI

image.png (441×459 px, 17 KB)

Change #1295470 had a related patch set uploaded (by Sadiya.mohammed13; author: Sadiya.mohammed13):

[mediawiki/extensions/Wikibase@master] Make statement values right-aligned for rtl languages on the mobile site

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

Change #1299325 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/extensions/Wikibase@master] Fix snak value display for rtl languages

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

Change #1295470 abandoned by Arthur taylor:

[mediawiki/extensions/Wikibase@master] Make statement values right-aligned for rtl languages on the mobile site

Reason:

abandoned in favour of I5a851501659177171afcbd3bd41402d36a6a6964

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

Change #1299325 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Fix snak value display for rtl languages

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

Change #1300168 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Arthur taylor):

[mediawiki/extensions/Wikibase@wmf/1.47.0-wmf.6] Fix snak value display for rtl languages

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

Change #1300169 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Arthur taylor):

[mediawiki/extensions/Wikibase@wmf/1.47.0-wmf.5] Fix snak value display for rtl languages

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

Change #1300169 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@wmf/1.47.0-wmf.5] Fix snak value display for rtl languages

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

Change #1300168 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@wmf/1.47.0-wmf.6] Fix snak value display for rtl languages

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

Mentioned in SAL (#wikimedia-operations) [2026-06-10T14:59:22Z] <lucaswerkmeister-wmde@deploy1003> Started scap sync-world: Backport for [[gerrit:1300169|Fix snak value display for rtl languages (T360854)]], [[gerrit:1300168|Fix snak value display for rtl languages (T360854)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-10T15:01:39Z] <lucaswerkmeister-wmde@deploy1003> lucaswerkmeister-wmde: Backport for [[gerrit:1300169|Fix snak value display for rtl languages (T360854)]], [[gerrit:1300168|Fix snak value display for rtl languages (T360854)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-06-10T15:08:01Z] <lucaswerkmeister-wmde@deploy1003> Finished scap sync-world: Backport for [[gerrit:1300169|Fix snak value display for rtl languages (T360854)]], [[gerrit:1300168|Fix snak value display for rtl languages (T360854)]] (duration: 08m 39s)