Batch Export Glossary

Hi There,

we're using Passolo 2018 (18.0.152.0) on multiple independent projects but with some similar vocabulary.

We want to create one gloassary per project and use these glossaries among all projects, so the translator does not need to download all projects to his machine.

To automate this we want to update the gloassaries automatically at night.

Question:

is there a possibility to export a gloassary file via pslcmd ? We did not find anything in the documentation.

Thank you

  • Hi Nina, 

    yes, this is possible. We do this in our environment. We also merge all exported glossaries into one. So it is only needed to provide one glossary over all projects.

    I am not sure if this is the best clean solution, but will share it nevertheless:

    Fist, the macro that exports a glossary (and also a TMX file, we need both) of an active Passolo project. Add this to your Passolo installation

    Sub main
    
      Dim prj As PslProject
      Set prj = PSL.ActiveProject
      If prj Is Nothing Then Exit Sub
    
      Dim lang As PslLanguage
      For Each lang In prj.Languages
        ' Create the translation bundle
        Dim bundle As PslTransBundle
        Set bundle = prj.PrepareTransBundle
    
        Dim trn As PslTransList
        Dim i As Integer
        For i = 1 To prj.TransLists.Count
          Set trn = prj.TransLists(i)
          If trn.Language Is lang Then
            bundle.AddTransList(trn)
          End If
        Next i
    
        ' Make filename "test<langcode>.tba/tbu"
        Dim filename As String
        filename = "<file path>" & prj.Name & "-" & lang.LangCode & ".glo"
        filename2 = "<file path>" & prj.Name & "-" & lang.LangCode & ".tmx"
        prj.Export "PASSOLO Glossary Maker", bundle, filename, expAllDeleted
        prj.Export "TMX Export", bundle, filename2, expAllDeleted
      Next lang
    End Sub

    I created a python script, that scans a folder for Passolo project files and calls the Macro for each project within a bat file:

    from os import listdir
    from os.path import isfile, join
    import subprocess

    lpufolder= "<path to your folder, where all Passolo projects are located>"

    batfilepath="passolocommands.bat"
    batfile = open(batfilepath, 'w+')

    batfile.write("cd \"C:\Program Files (x86)\SDL\SDL Passolo\SDL Passolo 2018\"\n")

    onlyfiles = [f for f in listdir(lpufolder) if isfile(join(lpufolder, f))]

    for lpu in onlyfiles:
         if lpu.endswith(".lpu"):
              print(lpu)
              batfile.write("pslcmd.exe "+lpufolder+"\\"+lpu+" /runmacro=<name of the macro bas file from above>.bas /quit\n")

    subprocess.Popen('powershell.exe C:\Jenkins\workspace\i18n_passolo_buenergy_glossaries\passolocommands.bat')

    Maybe this helps...

    Stay save.

    Markus