TMExporter does not do anything in Studio 2022 CU4

Hi I am not sure, which CU introduced this issue, but I just detected that the TMExporter does not actually export anything using Studio 2022 CU4 (TradosStudio2022_17.0.4.13209).

I tested my code against the initial release of Studio 2022 - and there it still works fine (i.e. TradosStudio2022_17.0.0.11594).

This is the code:

Try

                    Dim FileBasedTM As New Sdl.LanguagePlatform.TranslationMemoryApi.FileBasedTranslationMemory(strTMFile)

                    Dim TMExporter As New Sdl.LanguagePlatform.TranslationMemoryApi.TranslationMemoryExporter(FileBasedTM.LanguageDirection)

                    SourceLng = TMExporter.TranslationMemoryLanguageDirection.SourceLanguage.ToString

                    TargetLng = TMExporter.TranslationMemoryLanguageDirection.TargetLanguage.ToString

                    'TM export to TMX

                    AddHandler TMExporter.BatchExported, AddressOf Exporter_BatchExported

                    TMExporter.ChunkSize = 100

                    strExportFile = TMsPath & "\Export_" & strFileNoExt & ".tmx"

                    TMExporter.Export(strExportFile, True)

                Catch ex As Exception

                    Me.RichTextBox1.AppendText(ControlChars.Cr & strTMFile & " could not be exported." & ControlChars.Cr)

                    Me.RichTextBox1.Update()

                End Try

I am aware, that we should use Sdl.Core.TM.ImportExport and so I adjusted my code as follows:

Try

                    Dim FileBasedTM As New Sdl.LanguagePlatform.TranslationMemoryApi.FileBasedTranslationMemory(strTMFile)

                    Dim TMExporter As New Sdl.Core.TM.ImportExport.Exporter()

                    'TM export to TMX

                    AddHandler TMExporter.BatchExported, AddressOf Exporter_BatchExported

                    TMExporter.ChunkSize = 100

                    strExportFile = TMsPath & "\Export_" & strFileNoExt & ".tmx"

                    strImportFile = TMsPath & "\Import_" & strFileNoExt & ".tmx"

                    TMExporter.Export(FilebasedTM, strExportFile, True)

                Catch ex As Exception

                    Me.RichTextBox1.AppendText(ControlChars.Cr & strTMFile & " could not be exported." & ControlChars.Cr)

                    Me.RichTextBox1.Update()

                End Try

But the result is the same - the Export is started, the TMX file gets created but the process then does not fill it with exported TUs.

The process just never finishes and the file size remains at 0 kb.

As I said - I just tested against the initial release of Studio 2022 (which I happened to still find in my downloads folder) and with that release of Studio there is no problem...

Any chance to have this issue fixed?

emoji
Parents Reply
  • Dear Patrick,

    I installed Studio 2022 CU5 today and again tested the code. The interesting bit is:

    --> The code for the export function *does* work, if I compile it into a separate executable

    --> But if I compile the code as a Studio plugin it does not work.

    --> As I said, the plugin code itself still works with RTM release of Studio 2022 and the code has not been changed ever since, so the problem has to be in the Studio integration API. 

    If you want, I can send you the complete plugin project so that you can compile it and test it. I am a bit lost here, because even when stepping through the code in the debugger in VS, the TMExporter.Export(strExportFile, True) command sits there doing nothing. No debugging output. Simply nothing.

    I can also not find any difference between the reference code in the example and my code. From what I can see, it is identical, except for the fact that it is VB.net code and not C#.

    emoji
Children