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

Hi, originally, I posted this question here, but I think I chose the wrong forum at least there was zero feedback ... So I post here again and hope to receive feedback here Slight smile

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 code with highlighted section showing missing context information after export from a server TM.

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

Screenshot of Trados Studio TMX code with no visible errors or warnings, context information appears to be present.

I can also export the server TM from Trados Studio and from the Groupshare Web UI just fine and the exports always include the context information.

Also, as I said before - export from a SDLTM through the API also creates a TMX that includes the context information. 

It is really only the export from a server TM through the TM API that loses the context information. Is this a known issue? It basically means that - whereever automation of exporting TMX from server TMs is used to backup the TM data, this will currently lose the context information. 



Generated Image Alt-Text
[edited by: Trados AI at 4:12 AM (GMT 0) on 5 Mar 2024]