Uploading a TMX File

Upload a TMX file to Transifex.

Jacob avatar
Written by Jacob
Updated over a week ago

📝Note: Uploading TMX files is a feature only available on the Premium plan and up.

TMX (Translation Memory Exchange) is an industry-standard file format for Translation Memory. It lets you move TM data between systems and tools without losing any of your translations. With TMX files, you can, for example, import the TM from a tool you used previously or from any offline translation tool you work with.

Each project in Transifex has its own Translation Memory. To upload a TMX file:

  1. From the project navigation in the Dashboard, click on the project you want to import the TMX file to

  2. Click Settings

  3. Click on General in the submenu.

  4. Go to the Translation Memory Actions section and click the Import content from a TM… link.

    tm_import.png#asset:3472

  5. Select a file from your computer then hit Import.

    upload_tmx_new.png#asset:4552

    If you want to overwrite your existing TM with the contents of your TMX, check the box next to Overwrite existing TM and rebuild it from the TMX file. Since this is destructive behavior, we recommend reading the next section before proceeding.

    Please note that you can choose a specific language when selecting to overwrite TM:

    Overwriting-language.png#asset:4937

Supported Syntax in TMX File

Sample #1

Below you can find a simplified version supported by Transifex with en as source language and el as target language:

...
<tu>
<prop type="context"></prop>
<tuv xml:lang="en">
<seg>Password</seg>
</tuv>
<tuv xml:lang="el">
<seg>Kωδικός</seg>
</tuv>
</tu>
...

Sample #2

Let's now consider the following part of a valid TMX file, with en as source language and el as target language:

...
<tu>
<prop type="context"></prop>
<tuv xml:lang="en" creationdate="20210511T084001" lastusagedate="20211108T090745">
<seg>Password</seg>
</tuv>
<tuv xml:lang="el" creationdate="20210930T145229" lastusagedate="20211108T090745">
<seg>Kωδικός</seg>
</tuv>
<tuv xml:lang="el">
<seg>Κωδικός χρήστη</seg>
</tuv>
<tuv xml:lang="el" creationdate="20210930T145229" lastusagedate="20210930T145457">
<seg>Προσωπικός κωδικός</seg>
</tuv>
</tu>
...

Transifex takes into account the lastusagedate attribute of <tuv> elements grouped under the same <tu> element for a specific target language as long as such attributes are included in the TMX file.

In this case, “Κωδικός“ would be deemed as the most recent translation entry (based on lastusagedate value) and “Κωδικός χρήστη“ as the most stale one (no available lastusagedate value). Transifex gives priority to entries where lastusagedate attribute is present (i.e. consider them fresher/more recent) so that they may be used during TM auto fill-up tasks.

In the case where all translation entries grouped under the same <tu> element for a specific target language do not make use of the lastusagedate attribute at all, then the last translation version entry will be considered the most recent one. The same rules apply when the <tu> element contains pluralized sources and translations.


What happens when you upload a TMX file

By default, when you upload a TMX file, Transifex adds entries from the file to your existing TM. In other words, the two TMs are merged; existing entries in your TM are not affected.

As an example, let's say you have a TM with the following entries, where the left column represents your source strings and the right column represents the translations:

  • A → A1

  • B → B1

  • C → C1

And you upload this TMX file:

  • A → A2

  • D → D1

Afterwards, your TM will look like this:

  • A → A1

  • A → A2

  • B → B1

  • C → C1

  • D → D1

Note how both A1 and A2 are now present in your TM. Since A2 is newer, it will be used for Translation Memory Autofill, though both suggestions will be available to translators. If you want to delete A1, you can do so.

However, if you select the "Overwrite existing TM and rebuild it from the TMX file" option when uploading the TMX file, everything in your project's TM instance will be removed and replaced by the new entries after you hit Import.

Your TM will have the same content as the TMX file:

  • A → A2

  • D → D1

In both cases, existing translations will not be affected.


Filling TM without uploading a .tmx file

If you have done translations in the past and have both the source and translation files but don’t have a TMX file available, it might still be possible to load the translation data from previous translations into your project’s translation memory.

A few things to keep in mind before proceeding:

  • Source and target files should be in the same file format;

  • Source and target strings should map, i.e. in case of a key-value structure, the same keys should be used for both source and translation entries; in case of a non key-value file format, the same structure (new lines should be preserved in all files) should be followed by both source and translations files. This is to ensure that Transifex parser can map the translations to the corresponding source entries

  • Translations in a specific target language should be in a separate file: for example, if you have translated your content into 3 different languages, then you will need to have 3 different translation files, one per language

If these requirements are met, you can proceed with creating a TM from your source and available translation files:

  1. Upload the translations to the same resource file in Transifex.

As a result, every translation string maps with the source string and automatically becomes a part of your project's TM.


Continue Reading

Did this answer your question?