Page MenuHomePhabricator

Changes in language pair at the Confirm step are ignored
Closed, ResolvedPublic

Description

As part of MinT for Wikipedia Readers MVP (T359072), when selecting language pairs for the machine translation in Confirm step (T359512), the user selection seems to be ignored.

In the example below, the initial search for "Elephant" is done on English Wikipedia with the default language pairs for the Home step ("all" → "English"). After selecting the article from the search results, the "Confirm" step is shown. There, the language pair is adjusted to be "English → Spanish". However, accessing the translation results in contents being displayed in a language different than Spanish (notice the presence of characters such as ô, ö or ' that are not present in Spanish).

In contrast, when the same adjustment is done at the Home step, the issue is not present (i.e., the machine translation hows content in Spanish). Interestingly, the source content structure seems different. So it is not clear whether the issues comes from a problem updating the source or the target language indicated. Below you can check screenshots of both cases:

Setting the language pair at the Confirm step results in contents being displayed in an unexpected language.Setting the language pair at the Home step results in the contents being displayed in the expected language.
en.m.wikipedia.org_wiki_Special_MinT(Wiki Mobile).png (568×320 px, 85 KB)
en.m.wikipedia.org_wiki_Special_MinT(Wiki Mobile) (1).png (568×320 px, 83 KB)

Event Timeline

ngkountas changed the task status from Open to In Progress.May 13 2024, 6:51 PM
ngkountas claimed this task.

Change #1031399 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] MinT MVP: Re-fetch lead section translation on target language change

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

Change #1031399 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] MinT MVP: Re-fetch lead section translation on target language change

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

Test status: QA PASS

language pair at the Confirm step are no longer ignored

I noticed the issues may still be happening, although in a way that is harder to notice. The video below shows how the "Twin" article is selected, and the initial language pair is changed from " "Afrikaans to English" to "English to Spanish".
When the Translation View is accessed all UI elements seem to indicate that we are viewing the "English to Spanish" translation. However, the contents displayed are from the Afrikaans version of the Wikipedia article (note the difference in number of sections and images present in the English version )

Change #1039253 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] MinT ConfirmTopicPage: Fix source language update

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

Change #1039253 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] MinT ConfirmTopicPage: Fix source language update

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

Changing languages before reaching the translation view works as expected. the issue described above is no longer happening (example below illustrates how a translation from English to Catalan shows the sections present in the English article:

en.m.wikipedia.org_wiki_Special_AutomaticTranslation_page=Twin&from=en&to=ca&step=translation(Wiki Mobile).png (568×320 px, 44 KB)