Page MenuHomePhabricator

"Link to this message" in Special:Translate can produce a link with wrong language code
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Go to Special:Translate
  2. Choose a message group
  3. Change a language using the language selector (X)
  4. Open a message and click the "Link to this message" tool in the dropdown on the message key

Observed:
Language is not the chosen language X

Expected:
I am seeing exactly the same message I was looking before, in the correct language.

Event Timeline

abi_ triaged this task as Medium priority.

Change 509842 had a related patch set uploaded (by Abijeet Patro; owner: Abijeet Patro):
[mediawiki/extensions/Translate@master] Fix incorrect link to the message on translate editor

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

Fixes the incorrect link on Link to this message on the translate editor. Note that linking to a specific messages displays only that message on the message table.

Added code in the message table module to update the targetlangcode data attribute of the message table whenever the target language is updated using the ULS.

Test cases


TC #1 - Link to message should get the correct link

  1. Translate a page to French
  2. Copy the "Link to this message" link
  3. Open the link in a new tab
  4. Then change the target language to Spanish
  5. Copy the "Link to this message" link
  6. Open the link in a new tab

Expected behavior -
On step 3) you should see the French version of the message, and you should see the Spanish version of the message on step 6).

Change 509842 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Fix incorrect link to the message on translate editor

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

abi_ moved this task from QA to Done on the User-abi_ board.

Tested this on mediawiki.org, and I see that the language is now part of the query string for Link to message

image.png (752×1 px, 115 KB)