Renumerotation in Perl

Download : renum-to-omegat.pl / renum-to-trados.pl

This pair of scripts enable to solve the problem of tag numbering in SDLXLIFF files while using the Okapi XLIFF filter. They can also convert between Trados comments and OmegaT notes, and finally, add "translated" status to all segments which were not translated in the original file, but are filled by OmegaT. More details, with schema, in the technical document.

If you download DGT-OmegaT 3.1 or later, these scripts are already included: if you have an SDLXLIFF file in your project, all you have to do is to use OmegaT's script window, and use the script call-renum.groovy : this will call the Trados => OmegaT script and reload the project with the resulting XLIFF file. In the future, this script should be called via the wizard, but this does not work yet. At the end, when you compile the project, OmegaT will automatically call the OmegaT => Trados script and you can see the corrected SDLXLIFF in the directory target-trados (and native file in target-native)

In case you want to use the scripts outside from DGT-OmegaT, the files they produce can be edited with standard OmegaT 3.6 or 4.1 + Okapi filter, but you have to call the scripts manually (while DGT-OmegaT integrates them in the core). In this case, here is the syntax:

  • perl renum-to-omegat.pl <source sdlxilff> <target xliff>?
    • <source sdlxliff> is a path to the original file; absolute or relative, depending on where you call the script from
    • <target xliff> is a path to target file; optional, default is the name of the SDLXLIFF file where .sdlxliff is replaced by .renum.xlf
  • perl renum-to-trados.pl <original sdlxliff file> <translated renum-xliff file> <project_save.tmx>? <output sdlxliff file?>
    • <original sdlxliff file> is a path to the original file (the same as in renum-to-omegat, non-translated!) : this file is required because the renum-xlf file does not contain all the required data!
    • <translated renum-xliff file> is a path to the translated file, which should be in target directory of your project;
    • <project_save.tmx> (optional) will be used to convert OmegaT notes to Trados comments
    • <output sdlxliff file?> is a path to sdlxliff file to be produced; optional, default is the name of the renum-xlf file where .renum.xlf is replaced by .sdlxliff

Of course, in all cases you need Perl installed. If it does not work with call-renum.groovy, modify the script to tell where Perl is installed.

Add new comment