Page MenuHomePhabricator

Basic support for continuing an auto-saved translation on mobile
Closed, ResolvedPublic

Description

As part of the work to support translating in multiple sessions on mobile (more details in parent ticket: T319180), this ticket proposes to provide basic restoring capabilities to mobile translations:

  • Starting a translation for an article/section for which an in-progress, will result in continuing the translation.
  • Starting a translation for an article/section for which an in-progress article does not exist, was removed by the user, or it has been published, will result on a new translation (not continuing a previous draft). This is important to prevent issues such as the ones captured in T192065.

This ticket will not provide a list of translations to restore. Follow-up tickets will provide options to view in-progress translations (T260165), published ones (T260166) and switch between these views (T319181).

Scenario for QA testing

With this ticket, the basic support for translating in multiple sessions on mobile (T319180) will be completed with capabilities to auto-save translations (T322517), show appropriate warnings (T322518) and restore them (this ticket). Thus, the following scenario should work as described:

  1. Start a translation from English to Igbo for "Paneer".
  2. Edit the translation for a sentence and apply the proposed translation for the next one.
  3. Leave the translation editor and return to the dashboard.
  4. Depending on how the previous step was performed, a warning may appear to indicate that saving has not complete. Wait and try again if that is the case.
  5. Start again a translation from English to Igbo for "Paneer"
  6. The translation editor loads with the previously translated sentences present.
  7. Publish the translation in the sandbox.
  8. Start again a translation from English to Igbo for "Paneer"
  9. The translation editor loads without any previous translations.

Related Objects

Event Timeline

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

[mediawiki/extensions/ContentTranslation@master] CX: Introduce TranslationUnitDTO class and use it where needed

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

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

[mediawiki/extensions/ContentTranslation@master] SX: Introduce "fetchTranslationUnits" api method

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

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

[mediawiki/extensions/ContentTranslation@master] SX: Add draft restoration logic inside models

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

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

[mediawiki/extensions/ContentTranslation@master] SX: Fetch draft translation units inside "Pick a sentence" step

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

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

[mediawiki/extensions/ContentTranslation@master] SX: Restore translated sentences inside each paragraph (subsection)

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

Change 865664 abandoned by Nik Gkountas:

[mediawiki/extensions/ContentTranslation@master] SX: Restore translated sentences inside each paragraph (subsection)

Reason:

Moved this restoration logic inside subSection model: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ContentTranslation/+/865662/3

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

Change 865034 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX: Introduce TranslationUnitDTO class and use it where needed

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

Change 865661 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Introduce "fetchTranslationUnits" api method

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

Change 865662 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Add draft restoration logic inside models

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

Change 865663 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Fetch draft translation units inside "Pick a sentence" step

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

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

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

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

Change 869344 merged by jenkins-bot:

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

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

This ticket has similar tests like T322518

I will move this done. Please feel free to move back to the QA lane if I am wrong with my reason for marking it done

This ticket has similar tests like T322518

I will move this done. Please feel free to move back to the QA lane if I am wrong with my reason for marking it done

Based on your testing the general support for persistence seems to be in place. However, this particular ticket includes a specific QA scenario to test since it has been problematic in the past (continuing vs. restarting translation scenarios). SO it would be great to have it tested and documented to verify it works as expected and as a reference for potentially future regressions:

Scenario for QA testing

With this ticket, the basic support for translating in multiple sessions on mobile (T319180) will be completed with capabilities to auto-save translations (T322517), show appropriate warnings (T322518) and restore them (this ticket). Thus, the following scenario should work as described:

  1. Start a translation from English to Igbo for "Paneer".
  2. Edit the translation for a sentence and apply the proposed translation for the next one.
  3. Leave the translation editor and return to the dashboard.
  4. Depending on how the previous step was performed, a warning may appear to indicate that saving has not complete. Wait and try again if that is the case.
  5. Start again a translation from English to Igbo for "Paneer"
  6. The translation editor loads with the previously translated sentences present.
  7. Publish the translation in the sandbox.
  8. Start again a translation from English to Igbo for "Paneer"
  9. The translation editor loads without any previous translations.

This was as expected:

for this testing I am unable to attach the first part of the video as its a bit larger that phabricator likes. Able to attach the second part

I could not reproduce this. Trying to translate "Avocado" from English to Igbo, after step ·3 of the test scenario the translaito is not persisted. It does not appear in the in-progress list.
@EChukwukere-WMF, @ngkountas, is this due to a known bug reported elsewhere?

@Pginer-WMF since "Avocado" is not present in the Igbo wiki, you were trying to restore a lead section translation, which is a known issue reported here (T328533). Non-lead sections are normally saved and restored in all wikis as demonstrated by the screencast from greek wiki below. The fix for lead sections has just been deployed with the new CX build, so it's only visible inside the test wiki for now. I also include a screencast (the second one) that demonstrates the restoration of a saved lead section in test wiki. Please note, that unlike the test scenario describes, currently when returning to the translation through the search step or URL parameters, the translation is not restored. One should go to the "In progress" list and click on the draft translation, so that the translation is restored. If this is a strong requirement, it would be better to capture in a separate task.

Non-lead section in greek wiki:

Lead section in test wiki:

I got unexpected behaviour in the following case:

  1. Start a translaiton for new article (Avocado, en->ig)
  2. Add contents to the translation and leave editor
  3. Observed translation is properly stored in the in-progress list.
  4. Tap on the trash icon to delete the translation from in-progress list
  5. (Issue A:) If the page is not refreshed, starting a new translaiton for the same article loads the old contents. (expected: start translation from scratch)
  6. After refreshing the page, starting a new article starts it from scratch. However...
  7. (Issue B:) adding contents and leaving the editor doe snot result in the translation to be persisted and visible in the in-progress list.

A similar issue occurs when following the test scenario from the description (added one more step below to clarify what to check):

  1. Start a translation from English to Igbo for "Paneer".
  2. Edit the translation for a sentence and apply the proposed translation for the next one.
  3. Leave the translation editor and return to the dashboard.
  4. Depending on how the previous step was performed, a warning may appear to indicate that saving has not complete. Wait and try again if that is the case.
  5. Start again a translation from English to Igbo for "Paneer"
  6. The translation editor loads with the previously translated sentences present.
  7. Publish the translation in the sandbox.
  8. Start again a translation from English to Igbo for "Paneer"
  9. The translation editor loads without any previous translations.
  1. Add contents to the translation, leave the editor, and check the translaiton is not listed in the in-progress list. The expected behaviour is for the new translation to be listed in-progress.

Marked as resolved, work will continue in the follow-up tickets listed in T322521#8745905