- πΊπΈ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.
- Merge request !70Issue #3063893: Add suggestions from template when checking out jobs automatically β (Open) created by ksenzee
- Status changed to Needs review
4 months ago 12:16am 14 August 2024 - πΊπΈ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
4 months ago 10:00pm 3 September 2024 - Status changed to Needs review
3 months ago 3:00pm 12 September 2024 - πΊπΈ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.
- π¨π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()