Suggestions jobs are not created for each language in a multi-language scenario

Created on 25 June 2019, over 5 years ago
Updated 12 September 2024, 2 months ago

Problem/Motivation

In case of multi-language translation request, suggestions added for the first language are not kept for the other languages.

How to reproduce

  1. On node translation tab, select multiple languages and submit "Request translation"
  2. On the job submission page, tick suggestions and add them
  3. Then, tick the checkbox "Submit all X translation jobs with the same settings" in the "Configure provider" fieldset
  4. Click "Submit to provider and continue"

Jobs are created for each language but only the first one has suggestions appended (see screenshots attached).
In my example, I tried to translate EN to FR and DE. FR was the first language proposed.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Core

Created by

πŸ‡«πŸ‡·France Heisen-blue France

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States ksenzee Washington state

    We're also experiencing this. Wondering if it's an edge case, or if it's just that not many people use "Submit all X translation jobs with the same settings" together with suggestions.

  • Pipeline finished with Failed
    3 months ago
    Total: 430s
    #253318
  • Status changed to Needs review 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States ksenzee Washington state

    I've opened a MR that acts during automatic checkout and looks for items on the template job that don't exist on the job being checked out. It's O(n^2), so if there's a more efficient way to do it, input would be welcome. I'd also be happy to have pointers on where best to write a test for it.

  • First commit to issue fork.
  • Status changed to Needs work 2 months ago
  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    Reviewed.

  • Status changed to Needs review 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States ksenzee Washington state

    Updated per review, thanks @Berdir! Addressed all comments except the reverted condition; the only way I can make the logic work in my head is the way it’s already written.

  • Pipeline finished with Failed
    2 months ago
    Total: 428s
    #281314
  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    Thanks, yes reading again, I missed how the double loop applies, logic seems fine. Only alternative I see is hiding that in a separate method.

    We did just commit ✨ Create job for multiple target languages Needs review which adds a new way to do bulk submissions for providers that support that, this also copied that template job logic, it was just a few lines, this doubles it now. I'd suggest adding a protected function applyTemplate() that allows to reuse that code?

    Tests is a bit tricky. We have \Drupal\Tests\tmgmt\Functional\TMGMTUiTest::testSuggestions() as generic suggestions test, but we are missing a way to initialize a multi-checkout with the test source I think. We have \Drupal\Tests\tmgmt_content\Functional\ContentTmgmtEntitySourceUiTest::testNodeTranslateTabMultipleCheckout() for example for that, and \Drupal\Tests\tmgmt_content\Kernel\ContentEntitySuggestionsTest as a kernel test for content suggestions, would need to be a new test that combines a similar but probably simplified setup with testNodeTranslateTabMultipleCheckout()

Production build 0.71.5 2024