Any coders here to fix the XLIFF export/import macro?

There is this xliff export/import macro here.  One other user reported that it does not work, and I can confirm it.

As far as I can undertand the VBA code (and I wrote a bunch of VBA macros myself), the macro fails (at least on my computer) on trying to create the XLIFF document object. I was trying to use it in Passolo 2015 Translator Edition. Unfortunately VBA programming for XML is beyond me.

I would be nice if someone could fix the code, and it would be even nicer if someone could improve it, for example mark units that are outside my split, and those that use "Unify..." as untranslatale?

Thanks,

Piotr

Parents
  • This is an old topic, but I ran into the same problem yesterday so I think it is still of interest. Therefore I attach updated macros that can be used to export Passolo projects (.tbulic18) from Passolo Translator Edition 2018 into TMX and XLIFF files for use in e.g. Trados Studio. All credit to whoever wrote the original macros. I am no expert, my code changes are based on simple internet searches.

    Installation:
    Copy the macros to C:\Users\Public\Documents\Passolo Translator 2018\Macros

    Running:
    Tools > Macros > Macro List, select the macro and click Run. The .tmx or .xlf is saved in the same folder as the .tbulic18.

    Comments:
    The original macros are available at How to Export Text from Passolo File (direct link: translation-blog.com/.../Passolo.zip), but they were written for a previous MSXML version and produce errors when you try to run them. To fix the errors I just made these minor code changes:

    – DOMDocument > DOMDocument60
    – SAXXMLReader  > SAXXMLReader60
    – MXXMLWriter > MXXMLWriter60
    – Msxml2.DOMDocument > Msxml2.DOMDocument.6.0

    That is all that was needed to make the XLIFF macro work.

    The TMX macro still didn't produce a valid TMX that could be imported into an SDLTM and to fix that I made these additional changes:
    – Inserted an empty <header/> tag
    – Deleted all code lines related to notes, since the original macro inserted <note> elements inside <tuv> elements which Trados didn't like. Perhaps these note elements could be moved up one level instead, as direct children to the <tu> element, but I haven't looked into that. Feel free to improve.

  • I noticed that the XLF and TMX export macros had stopped working in Passolo 2022 Translator Edition so I made some minor adjustments to get them going again, just changing one line of code in each .bas file.

    I also noticed that the previous link to the files wasn't working anymore since it had been accessed more than 50 times, so I have updated that one as well now pointing to a Dropbox folder which will hopefully work better:

    Passolo macros

    emoji
  • Ok, I managed to adapt the script to my needs: export all untranslated strings of each project language to xlif.

    If anyone else has this task, ping me.

    emoji
  • Not sure what you mean by "call the script automatically without user interaction". Do you mean how to export all target languages in one go? I have no experience of that since I have only worked with one target language at a time, but you seem to have fixed it yourself now.

    emoji
  • Exactly. I automatically export the untranslated strings of my Passolo projects.

    However, the script above imports the text of an import file into all my target languages.

    I've added the condition in line 70 and it works fine now. Just to let you all know.

    emoji
  • Former Member
    0 Former Member in reply to Markus Kaußen

    ping ;)

    emoji
  • Hi Stephan, sorry for beeing late to the ping party.

    Find the adapted sript attached. What is the script doing:

    • Exports the currently active project as GLO file (required in our case)
    • Update the Quick Index
    • Preform an AutoTranslate (only 100% matches, multiple matches will not be translated)
    • Export the remaining untranslated strings per language into en "00 Export" folder (same location as the lpu)


    emoji
  • Former Member
    0 Former Member in reply to Markus Kaußen

    What am i missing?

    After starting the makro line 35 turns red.

    emoji
  • <PATH TO GLOS> must be replaced by a folder path where the flos should be placed, E.h. C:\myglos\

    emoji
  • Former Member
    0 Former Member in reply to Markus Kaußen

    I see. Now i am stuck here:

    Do i need to replace anything here, too?

    EDIT1 : Hmm the Export Folder is missing. I am working with nwtwork drives.. could it be that passolo does not have the nessecary rights to create a new folder?

    emoji
  • Former Member
    0 Former Member in reply to Former Member

    I created the Export Folder by myself. The Script runs now without error and exports all files. But how do i import them back in one step?

    emoji
  • I have not implemented this yet. In our processes, a manual import is required.

    We use the UI based script from above to proceed the import per language.

    Note that for the successful import with the ui script, the files must be placed in the same folder as the *.lpu file.

    emoji
Reply Children
  • Former Member
    0 Former Member in reply to Markus Kaußen

    After Exporting with your script, editing in Trados and import back the translated file i get this error:

    It is only one file from a bunch of files of my project and its not fully translated.

    Any idea?

    If Translatable Then
      ImportAll = ImportAll + 1
      Set newStringNode = newFileNode.firstChild
          While Not newStringNode Is newFileNode.lastChild And Not (newStringNode.attributes.getNamedItem("id").Text=CStr(transstr.ID) And newStringNode.firstChild.Text = Trim(transstr.SourceText))
                   Set newStringNode = newStringNode.nextSibling
          Wend

    Line 256

    emoji
  • Need to try to reproduce this one.

    But: If you work with Trados and you need these files to be translated with Trados, I highly recommend using the build in SDLXLIFF export.

    This can be automated as well.

    We need the XLF file for other system compatibility.

    Do you know how to do this? If not, I would try to find some time to build a Macro which does the job.

    emoji