Page MenuHomePhabricator

mw-translate-fuzzy has no lang or dir attribute
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:
The mw-translate-fuzzy message has no lang or dir attribute. It is inside #mw-content-text, so the page language and direction are used instead. They don't match the message language, which causes bidi algorithm issues.

What should have happened instead?:
The message should have the appropriate lang and dir attributes for the interface language.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:

image.png (67×754 px, 18 KB)

Event Timeline

Change 714323 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] TranslationPage: Add dir/lang attribute for outdated translation header

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

abi_ triaged this task as Medium priority.

Change 714323 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] TranslationPage: Add dir/lang attribute for outdated translation header

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

Tested on Translatewiki.net

The Outdated translations are marked like this. will now have the requested lang / dir attribute.

The lang / dir attribute will reflect the language that is requested, not necessarily the one that we get. For example, if the UI language is set to Sindhi (sd), it’ll result in <div dir="rtl" lang="sd">, but the text itself will be in English, as https://translatewiki.net/wiki/MediaWiki:Tpt-translation-intro-fuzzy/sd doesn’t exist.

This happens due to a limitation with the LocalisationCache. The LocalisationCache does fallback merging and loses the information about the original language.

See here for related discussion: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Translate/+/714323/3#message-bd0eaa199ddbe87582ed6000acf701494e7ee369