Page MenuHomePhabricator

Special:Translate: HTML metadata should change when you switch language dynamically
Open, Needs TriagePublicBUG REPORT

Description

In Special:Translate, the div that wraps most of the translate interface (.tux-messagelist) has some metadata about the current translation going on. When translating into nb, it looks like this:

<div class="row tux-messagelist" data-grouptype="RecentAdditionsMessageGroup" data-sourcelangcode="en" data-sourcelangdir="ltr" data-targetlangcode="nb" data-targetlangdir="ltr">

However, when you change the language using the language selector in the top right corner, the data-targetlangcode and data-targetlangdir attributes aren't updated. @Tacsipacsi
mentioned in this thread that directionality in the edit box also doesn't update if you switch between LTR and RTL languages, so there are probably more attributes affected by this.
(Edit: This seems to have been fixed by @Nikerabbit back in September.)
List of steps to reproduce (step by step, including full links if applicable):

What happens?:
The attributes on .tux-messagelist stay the same, not reflecting the fact that you are now no longer translating into nb.

What should have happened instead?:
The data-targetlangcode and data-targetlangdir attributes should be updated.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:
MediaWiki 1.38.0-alpha, Translate 2021-10-25

Event Timeline

Adding you as subscriber, @abi_, since you're already working on some target language-related stuff, so maybe this would fit into that. :-)

Change 745997 had a related patch set uploaded (by Jon Harald Søby; author: Jon Harald Søby):

[mediawiki/extensions/Translate@master] Change HTML data attributes when target language changes

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

jhsoby moved this task from Backlog to tux on the MediaWiki-extensions-Translate board.
jhsoby added a subscriber: Nikerabbit.

Change 745997 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Fire hook when translation view state changes

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