Export translation units to TMX in Passolo

Hi,

I'm trying to export translation units that meets certain criteria in a Passolo project to a TMX file using macro.  I've been reading documentation available online to write macro, but it seems that exporting only a subset of translation units from multiple translation lists in a Passolo file is not possible.  My understanding by reading the documentation is that you can export translation units in a Passolo file for its entirety to a TMX file using the PslTransBundle object, but not just only certain translation units that meets certain criteria.

Can somebody confirm my understanding is correct?

Regards,

Parents
  • When exporting using the PslTransBundle object, you can just insert complete translation list objects PslTransList with all items.

    If you want to export just parts into a TMX file loop all items within the PslTransList objects that you want to export. That allows you to check your export criteria for each PslTransString

    Writing the TMX file also must be part of your code

  • Thank you for your input.  I'm writing codes with a loop to go through all translation units in a Passolo file, evaluate each of them to see if it meets my criteria, and if it does, export the TU to .tmx file.  My codes look like this for the loop:

    For Each lang In prj.Languages
      'Create the translation "bundle" for TMX export
      Dim bundle As PslTransBundle
      Set bundle = prj.PrepareTransBundle
      For Each translst In prj.TransLists
        For i = 1 To translst.StringCount
          If translst.Language Is lang Then
            If (translst.String(i).DateTranslated > dateModifiedSpecified) Then
              translst.String(i).OutputError(lang.LangCode & ": " & translst.String(i).DateTranslated)
              bundle.AddTransList(translst.String(i))
            End If
          End If
        Next
      Next
      Dim filename As String
      filename = "C:\_MyWork\Temp\" & lang.LangCode & ".tmx
      prj.Export "TMX Export", bundle, filename
    Next lang

    The if statement "translst.String(i).DateTranslated > dateModifiedSpecified" evaluates each TU in Passolo file (the dateModifiedSpecified has been already defined at the beginning of the codes), and the "translst.String(i).OutputError" statement is indeed working (the TU that meets the criteria does get displayed in the Messages pane in Passolo), but no .tmx files gets generated under the C:\.  Shouldn't the "prj.Export "TMX Export", bundle, filename" creates .tmx file with the above codes?


  • Hi, Windows 10 you can't  write at the root of the c:\ drive. Write the file in a subfolder.

Reply Children