Select Page

From time to time, freelance translators and PMs need to perform tasks like merging files of TMX format.

GNU/Linux systems offer a plethora of resources in their repositories for file management and one of our allies is the FLOSS library libxm-tmx-perl.

It can be easily installed from your favourite package manager, or simply from the command line as root:

# apt-get update && apt-get install libxm-tmx-perl

As we can read in the package description, it is a very useful tool with several modules that can be run from the command line:

XML::TMX is a collection of modules that provide functions to deal with TMX (Translation Memory eXchange) files, like creating new files, or reading and processing existing files. It also provides tools to create TMX files from other sources.

One of its components is the tmx2tmx module. It effectively merges and even cleans up translation memories by removing empty lines, segment pairs where one side is empty and other garbage.

A simple and swift procedure to merge your TMX files can be as follows:

  1. Create a folder with all the tmx files you need to merge.
  2. Open a terminal there and type:
ls | grep '.tmx$' | tmx2tmx -clean -cat > file.tmx

…where file.tmx is the name of the resulting TMX concatenated file. Note that the “-clean” switch triggers the automatic cleaning of the processed file as described above.

To see all the options you can use, take a look at the man page from the command line:

man tmx2tmx

The newer versions of this useful library include new modules with more functions which ease simple tasks. Find more here.

 

 

I. Carretero – Albucasis Specialty Translations