Page MenuHomePhabricator

Incorrect diff display in translation extension prompt: "This translation may need to be updated. Show differences?"
Closed, ResolvedPublic4 Estimated Story PointsBUG REPORT

Description

When a translation needs to be updated, the translation extension shows a text that says "This translation may need to be updated. Show differences?" Clicking on the "Show differences" displays something different.

Steps to replicate the issue (include links if applicable):
*When translating this page, in the Finnish or Italian version. this paragraph displays a very old version of the whole page's source code instead of the diff.

Displays

Screenshot 2023-02-23 at 15.48.59.png (1×2 px, 488 KB)

Instead of

Screenshot 2023-02-23 at 15.49.18.png (1×2 px, 727 KB)

The above issue was report by @Kyykaarme at meta-wiki.

Event Timeline

UOzurumba renamed this task from Incorrect diff display in translation extension prompt "This translation may need to be updated. Show differences?" to Incorrect diff display in translation extension prompt: "This translation may need to be updated. Show differences?" .Feb 23 2023, 11:13 PM
UOzurumba added subscribers: Pginer-WMF, Nikerabbit.
Tacsipacsi subscribed.

I have also experienced this a few times before, but I didn’t care enough to report it. :)

This should only affect very old translations where the source revision was tracked differently.

And would it be possible to fix it, either by doing a database migration, or by adding a compatibility layer? It’s rare but annoying; it’s not only hard or impossible to read (I don’t remember if it even highlights the actual differences), but also impossible to get rid of – once you’ve opened the diff, you can’t close it, and need to scroll multiple screens between the English text and the translation textbox.

Some things that I left out from my post on Meta, 'cause I thought it was confusing enough already:

This might be another issue, but the translation extension doesn't detect these "corrupted" paragraphs. For example, the Finnish ToU says it's 100% complete, and there are no Outdated translations if you open the extension. But this paragraph actually has an outdated translation. (It's also one of the corrupted paragraphs that shows the super old text if you click on the blue text.)

I noticed this whole thing when I was hunting down a lint error that made the font in half of the page look funny. The same lint error is still visible in at least two other ToU pages, such as here. This is the paragraph where the lint error is on that page, and the extension doesn't detect it, but this one is not "corrupted" and instead shows the normal comparison with the old and new text.

Change 891934 had a related patch set uploaded (by Pols12; author: Pols12):

[mediawiki/extensions/Translate@master] UpdatedAid: ensure definition is older than translation

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

My patch provides a supplementary condition to skip these issuing units, but I’m not sure it is worthwhile, given they are pretty rare, and increasingly rare.

I don’t know the database revtag table content for those legacy cases: maybe a script could fix them.

This might be another issue, but the translation extension doesn't detect these "corrupted" paragraphs.

This is not a bug: since the content has not changed (some parts have been wrapped in tvar, but final content remains), the translation administrator has chosen not to invalidate translations.

This might be another issue, but the translation extension doesn't detect these "corrupted" paragraphs.

This is not a bug: since the content has not changed (some parts have been wrapped in tvar, but final content remains), the translation administrator has chosen not to invalidate translations.

I'm not familiar with how the extension works, but when you open the individual paragraph, you can see that the Brazilian Portuguese translation has tt tags, and the English version has the dollar sign thingies. That paragraph is not "corrupted": if you wait a few seconds, the "diff" loads and you can see the differences in the original text. But if you click the "Oudated" link above the parapgrah, the extension doesn't show this paragraph as outdated.

The lint error has found its way to the Brazilian Portuguese translation of the 2023 ToU Updates.

The outdated status communicates to readers (by adding a pink background color) that the translation may not be accurate anymore, and they might want to check out the original version; and communicates to translators (by displaying the message in the “Outdated” tab) that the translation should be reviewed and updated as necessary. What has been changed in this message doesn’t make old translations less accurate and thus doesn’t require manual review by translators (fixing lint errors is not translators’ job, it can be done by any wikignome, without language knowledge), so the translation administrator decided that this source message change should not make old translations outdated, so that readers don’t need to look up the English version just to find out that the translation is absolutely accurate and translators can concentrate on updating translations that are indeed outdated.

@Tacsipacsi Thanks for the detailed explanation, I get it now. :)

Change 891934 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] UpdatedAid: ensure definition is older than translation

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

Nikerabbit set the point value for this task to 4.Apr 4 2023, 12:17 PM
Pols12 removed Pols12 as the assignee of this task.Apr 5 2023, 3:10 PM

No time in the next days to review my patch. I will try to handle this issue before one month, if someone else hasn’t claimed it yet.

I don’t achieve to reproduce this locally (having source_unit_id > translation_unit_id): I tried to manually edit the ID in the database, carefully editing stranger keys too, but that still broke the translatable page. Any help would be appreciated: how to edit a unit ID without breaking anything?

By the way, since the original link is no more active, this is another reproduction page.

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

[mediawiki/extensions/Translate@master] UpdateDefinitionAid: Ensure old revision has the same definition id

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

Some debugging from the database:

I fetched revisions and page associated with this translation unit by using its Article/Page Id:

select * from revtag where rt_page = 1425892;
+-------------+---------+-------------+----------+
| rt_type     | rt_page | rt_revision | rt_value |
+-------------+---------+-------------+----------+
| fuzzy       | 1425892 |     4262069 | NULL     |
| tp:transver | 1425892 |     4262069 | 4241020  |
+-------------+---------+-------------+----------+

Using the rt_value of 4241020 and selecting the revision:

select * from revision where rev_id =4241020;
+---------+----------+----------------+-----------+----------------+----------------+-------------+---------+---------------+---------------------------------+
| rev_id  | rev_page | rev_comment_id | rev_actor | rev_timestamp  | rev_minor_edit | rev_deleted | rev_len | rev_parent_id | rev_sha1                        |
+---------+----------+----------------+-----------+----------------+----------------+-------------+---------+---------------+---------------------------------+
| 4241020 |  1260971 |              2 |        13 | 20121012000944 |              0 |           0 |    8279 |       4238501 | 5mi0vfaog46z3vy3p2o6z0t92wlfyp7 |
+---------+----------+----------------+-----------+----------------+----------------+-------------+---------+---------------+---------------------------------+

I noticed that the rev_page is completely different and points to the following page: https://meta.wikimedia.org/wiki/Fundraising_2012/Translation/Donor_information_pages

Change 930634 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] UpdateDefinitionAid: Ensure old revision has the same definition id

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