Problem/Motivation

In #1971672: Switch to XLIFF format we wanted to (XLIFF) export a single job item id instead of whole job object, but then we realised it's not implemented yet.

Proposed resolution

Add support to export single job item id by adding a new parameter in export() method in TMGMTFileFormatInterface class.

Comments

mbovan created an issue. See original summary.

mbovan’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new2.09 KB

Added $tjiid parameter into TMGMTFileFormatInterface::export().

berdir’s picture

Status: Needs review » Needs work
+++ b/translators/file/tmgmt_file.format.xliff.inc
@@ -170,7 +170,8 @@ class TMGMTFileformatXLIFF extends XMLWriter implements TMGMTFileFormatInterface
 
-    foreach ($job->getItems() as $item) {
+    $tjiid_condition = $tjiid ? ['tjiid' => ['value' => $tjiid]] : [];
+    foreach ($job->getItems($tjiid_condition) as $item) {
       $this->addItem($item);

I like using conditions, I would probably just have hardcoded an ID check.

If we do that, then lets just do the most flexible thing. Just pass conditions through.

The last submitted patch, 2: support_xliff_export-2646158-2.patch, failed testing.

mbovan’s picture

Status: Needs work » Needs review
StatusFileSize
new2.25 KB
new2.53 KB

Fixed.

Status: Needs review » Needs work

The last submitted patch, 5: support_xliff_export-2646158-5.patch, failed testing.

  • Berdir committed f41eb1b on 7.x-1.x authored by mbovan
    Issue #2646158 by mbovan: Support XLIFF export for a single job item
    
berdir’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Needs work » Patch (to be ported)

Thanks, committed.

We'll need this in 8.x too when we port tmgmt_oht.

mbovan’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new2.37 KB

Here it is.

berdir’s picture

Status: Needs review » Fixed

Committed, thanks

  • Berdir committed f8ce0c4 on 8.x-1.x authored by mbovan
    Issue #2646158 by mbovan: Support XLIFF export for a single job item
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.