Exporting a Server TM using the TranslationMemory API results in a TMX file that misses the context matching information

Hi, I have detected a problem with the Exporter class in the TranslationMemory API. The problem is that - when a server TM gets exported, the TMX is missing the context information after the export.

Here is my code:

Dim TMExporter As New Sdl.LanguagePlatform.TranslationMemoryApi.TranslationMemoryExporter(ServerBasedTranslationMemory.GetLanguageDirection(LangDir))

TMExporter.ChunkSize = 100

TMExporter.FilterExpression = GetFilterCreatedAt()

AddHandler TMExporter.BatchExported, AddressOf Exporter_BatchExported

strExportfile = ExportFolder & "\" & ServerTM & "_" & LanguageDirection.SourceLanguageCode.ToString & "_" & LanguageDirection.TargetLanguageCode.ToString & ".tmx"

Try

      Dim strNow As String = Now.ToString("yyyyMMdd_HHmmss")

      TMExporter.Export(strExportfile, True)

      System.IO.File.AppendAllText(LogFile, ControlChars.CrLf & strNow & " SUCCESS: " & ServerTM & " , Source Language: " & LanguageDirection.SourceLanguageCode.ToString & " , Target Language: " & LanguageDirection.TargetLanguageCode.ToString
      & " was successfully exported to " & strExportfile & ". " & exportProgress.ToString & " TUs were exported." & ControlChars.CrLf)

Catch ex As Exception

      Dim strNow As String = Now.ToString("yyyyMMdd_HHmmss")

      System.IO.File.AppendAllText(LogFile, ControlChars.CrLf & strNow & " ERROR: " & ServerTM & " , Source Language: " & LanguageDirection.SourceLanguageCode.ToString & " , Target Language: " & LanguageDirection.TargetLanguageCode.ToString &
      " could not be exported. The original error message was: " & ex.ToString & ControlChars.CrLf)

      System.IO.File.Delete(ExportFolder & "\" & ServerTM & "_" & LanguageDirection.SourceLanguageCode.ToString & "_" & LanguageDirection.TargetLanguageCode.ToString & ".tmx")

End Try

This code - when run on a local SDLTM exports everything just fine including the context information:

Screenshot of Trados Studio TMX file with highlighted sections showing 'prop type' tags including 'x-IncludesContextContent' set to 'True' and 'x-ContextContent' with missing context information.

But when I run it on a server TM, the TMX misses the context information after the export finishes:

Screenshot of Trados Studio TMX file showing 'prop type' tags without highlighted errors, but missing context information in 'x-Context' tag.



Generated Image Alt-Text
[edited by: Trados AI at 10:51 AM (GMT 0) on 4 Mar 2024]
emoji
Parents Reply Children
No Data