Page MenuHomePhabricator

Support continuing translations started on a different device
Closed, ResolvedPublic

Assigned To
Authored By
Pginer-WMF
Mar 23 2023, 9:23 AM
Referenced Files
F41507924: scenario-d-part2-optimized.webm
Nov 15 2023, 3:21 PM
F41507906: scenario-d-part1.webm
Nov 15 2023, 3:21 PM
F37852887: test0909.webm
Sep 29 2023, 2:36 PM
F37852874: creation.webm
Sep 29 2023, 2:36 PM
F37849373: test32.webm
Sep 29 2023, 11:32 AM
F37849328: continuation-on-desktop.webm
Sep 29 2023, 11:32 AM
F37849283: draft-creation.webm
Sep 29 2023, 11:32 AM
F37832246: test-2.webm
Sep 28 2023, 3:46 PM

Description

Content and Section Translation are able to support creating a new article and expanding it with a new section by translating on mobile and desktop. Since translation work is persisted, it is possible to work during multiple sessions on different platforms. This ticket describes the expected behaviour for different combinations of sessions across multiple devices.

The major difference between the translation editors in both platforms is that for new articles, the desktop editor allows working with the full article content while the mobile one allows only to work with the lead section.

The intended behaviour is described for the combinations below.

A) New article started on desktop and continued on mobile

The mobile editor will load only the lead section for the desktop-created draft.
If the desktop-created draft includes content from other sections in the translation:

  • Inform the user that the translation was started on a different platform and continuing on mobile requires to work on one section at a time. So the contributions to other sections will be recovered after the user publishes the initial article.
  • Updates with the mobile editor will update the draft contents on the lead section part of the desktop-created draft.
  • After publishing the lead section, create in-progress translations for the different sections for which the original desktop translation had contents.

Additional considerations. This approach could be described as splitting the large desktop-created translation. The split is intended to happen when publishing. This means that:

  • It should be possible to start a translation on desktop which includes several sections, load the lead section on mobile and fix some typos on the lead section, and return to desktop to get a single draft with the translation covering several sections (with the typos fixed).
  • After the translation is published on mobile, there will be an article published with the lead section contents and optionally several section translations in draft. This will be the case when accessing later the dashboard with either platform. The initial draft containing both lead and other sections is gone since it has been split by sections after publishing the lead section on mobile.

Proposed message

A standard dialog will be shown with the following message:

Continuing a translation on mobile

This translation was started on a different device, and it includes contents for multiple sections of the article.

On mobile you can only work with one section at a time. Thus, only the main section will be loaded for now.

Where are the other sections?

Don't worry. The remaining sections are not lost. They will become available once you publish the current translation as a new article. After publishing, you'll find a new in-progress translation with the contents for each section.

[Ok]

The "Ok" button closes the dialog.

A2) New article started on desktop and continued on mobile (when already present in the target wiki)

This is a variant of the scenario (A) above, with the particularity that at the time of loading the article on mobile, the target article already exists (e.g., another editor created it independently). In such case, we want to make available the sections from the draft translation immediately (it won't make sense to force the user to publish the lead section to have access to the ). The approach is described below in more detail (bold used to highlight the differences with the previous scenario):

The mobile editor will load only the lead section for the desktop-created draft.
If the desktop-created draft includes content from other sections in the translation:

  • Inform the user that the translation was started on a different platform and continuing on mobile requires to work on one section at a time, and indicate that contributions to other sections have been recovered..
  • Updates with the mobile editor will update the draft contents on the lead section part of the desktop-created draft.
  • As soon as the mobile editor opens, create in-progress translations for the different sections for which the original desktop translation had contents.

Proposed message

A standard dialog will be shown with the following message:

Continuing a translation on mobile

This translation was started on a different device, and it includes contents for multiple sections of the article.

On mobile you can only work with one section at a time. Thus, only the main section will be loaded for now.

Where are the other sections?

Don't worry. The remaining sections are not lost. They are now available in the list of your in-progress translations and can be used to expand the existing article. You'll find a new in-progress translation with the contents for each section.

[Ok]

The "Ok" button closes the dialog.

B) New article started on mobile and continued on desktop

When continuing a mobile-started article on desktop, the desktop editor will load the whole article as source (it can include multiple sections) and the translation will include the contents from the lead section. Editors can add more contents to the translation including content from other sections.

If the user added additional sections and moves back to mobile, this situation will be handled as the case (A) above.

C) Section started on desktop and continued on mobile

Both mobile, and desktop editors will load the translation on section mode. In both cases the visibility of content is the same and publishing will lead to a new section being created.

D) Section started on mobile and continued on desktop

Both mobile, and desktop editors will load the translation on section mode. In both cases the visibility of content is the same and publishing will lead to a new section being created.

Representation in the dashboard lists

The in-progress and published lists in the dashboard represents items in two different ways depending on whether they are translation to create a new article or expand with a section. New article translations may contain just the lead section or additional sections (this only on some translations edited with the desktop editor). It is ok to display articles and sections of the same topic in the in-progress and published status to reflect the status of their translations.

Dashboard lists - In progress (2).png (647×503 px, 83 KB)

Event Timeline

Pginer-WMF triaged this task as Medium priority.Mar 23 2023, 9:23 AM
Pginer-WMF created this task.

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

[mediawiki/extensions/ContentTranslation@master] SX: Fetch translations started on CX and show them in dashboard list too

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

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

[mediawiki/extensions/ContentTranslation@master] CX: Use PARSER_MODE for node-DOM conversion by VE for text paragraphs

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

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

[mediawiki/extensions/ContentTranslation@master] SX: Restore on mobile (SX), translation started on desktop (CX)

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

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

[mediawiki/extensions/ContentTranslation@master] CX: Use the same format as SX for section ids inside corpora units

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

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

[mediawiki/extensions/ContentTranslation@master] CX: Support restoration of templates translated on mobile

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

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

[mediawiki/extensions/ContentTranslation@master] SX: Add "data-mw-cx-source" attribute to corpora units

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

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

[mediawiki/extensions/ContentTranslation@master] SX: Split translation into section translations after publishing

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

@ngkountas I edited the description to capture in the (A2) section a variant of the scenario (A).
In short, depending on whether the article already exists in the target wiki or not, we may need to create the in-progress translations for each section when loading the translaiton on mobile (A2) or when publishing it (A).

An alternative to simplify things could be to discard A, and follow the approach mentioned in A2 in both cases. That is, loading a draft created on desktop will result in new in-progress translations for the other sections. In such case, the only challenge is when trying to continue an in-progress section for an article that does not exist. In such case, we can show a simple dialog warning the user that they have to translate the lead section to create an article before it can be expanded, with the option to do so. Note that this could be also useful in cases where the article was deleted.

@ngkountas feel free to share your thoughts on which could be the best direction considering the technical complexity and status of current code in this area.

Change 918350 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Fetch translations started on CX and show them in dashboard list too

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

Change 932684 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20230626

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

Change 932684 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20230626

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

Change 919007 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Restore translation started on desktop (CX)

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

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

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20230710

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

Change 936678 abandoned by Nik Gkountas:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20230710

Reason:

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

Change 919008 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX: Use the same format as SX for section ids inside corpora units

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

Change 919009 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX: Support restoration of templates translated on mobile

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

Change 919010 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Add "data-mw-cx-source" attribute to corpora units

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

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

[mediawiki/extensions/ContentTranslation@master] SX: Add confirmation dialog for continuing drafts started on desktop

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

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

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20230808

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

Change 946931 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20230808

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

Change 919302 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Split translation into section translations after publishing

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

Change 952858 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20230828

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

Change 946571 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Add confirmation dialog for continuing drafts started on desktop

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

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

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20230904

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

Change 954671 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20230904

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

Change 952858 abandoned by Nik Gkountas:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20230828

Reason:

abandoning since we have already merged a newer build (I7d69dfb6c215a7769e74483bfa25d0b0ce2520a2)

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

QA for Scenario A

The Scenario A seems to work properly on production as demonstrated by the following screencasts from greek (el) production wiki:

Creation of a draft translation in desktop:

Continuation of the draft and publishing in mobile:

QA for Scenario B (New article started on mobile and continued on desktop)

The Scenario B seems to work properly on production as demonstrated by the following screencasts from greek (el) production wiki:

Creation of a draft translation on mobile:

Continuation of the translation on desktop:

Re-continuation and publishing of the translation on mobile:

ngkountas updated the task description. (Show Details)
ngkountas updated the task description. (Show Details)

QA for Scenario C (Section started on desktop and continued on mobile)

Scenario C seems to work properly on production as demonstrated by the following screencasts from greek (el) production wiki:

Creation of a draft section translation on desktop:

Continuation and publishing of the translation on mobile:

QA for Scenario D (Section started on mobile and continued on desktop) fails because of two issues:

  1. Continuing a draft non-lead section translation on desktop (from the unified dashboard) doesn't add the necessary "sourcesection" URL parameter, thus the section translation doesn't start (one have to manually add the "sourcesection" URL param). This will be fixed once this patch is deployed with the next CX build.
  2. Publishing a section translation on desktop is blocked as described in T347720.

The scenario D can now be verified. Here are two screencasts from greek (el) wiki. In the first one we create a draft translation on mobile. In the second we continue that draft translation and publish it on desktop.

Part 1:

Part 2:

In the second part one can observe another issue related to sandbox publishing but it's not related to this task and has been captured in T351318.

@Pginer-WMF Given the above QA I believe we can close this ticket as done. Although the scenario A2 has not been yet supported I believe that this should be captured in a separate task and be prioritize accordingly, as it's not a trivial functionality to support (we will need to deploy a new backend API endpoint). The rest scenarios have been verified to work as expected in production.

Nikerabbit changed the task status from Open to In Progress.Nov 23 2023, 8:50 AM

Thanks for the great work @ngkountas!

I captured adjustments (for the general approach, avoiding fragmentation for edge cases) in a separate ticket: T351893: Adjust the handling of sections when continuing translations started on a different device