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:
But when I run it on a server TM, the TMX misses the context information after the export finishes:
Generated Image Alt-Text
[edited by: Trados AI at 10:51 AM (GMT 0) on 4 Mar 2024]