## Translation memories

- OmegaT and TMX files
  - Location and purpose
  - TMX backup
  - TMX and Language
- How OmegaT remembers your translations
- Using translation memories from previous projects
- Using memories created by other translation tools
  - Importing files
  - Imported files handling
- Using OmegaT translation memories in other translation tools
- Pseudo-translated memory
- Upgrading Translation Memories

## OmegaT and TMX files

### TMX files - location and purpose

OmegaT uses TMX files in 3 separate locations.

- The /omegat/ folder contains project_save.tmx and eventually a number of backup TMX files.

  The file project_save.tmx contains all the segments that have been memorized since you started the project.

- The project main folder will contain 3 TMX files:

  1. project_name-omegat.tmx
  2. project_name-level1.tmx
  3. project_name-level2.tmx
  (project_name being the name of your project).

  These files contain the source and target segments corresponding to the contents of the /source/ folder at the time of their creation (usually when the translated files have been created).

  - The level1 file contains only textual information.
  - The level2 file encapsulates OmegaT specific tags in correct TMX tags so that the file can be used with its formatting information in a translation tool that supports TMX level 2 memories, or OmegaT itself.
  - The omegat file includes OmegaT specific formating tags so that the file can be used in other OmegaT projects
- The /tm/ folder can contain any number of TMX files. Such files must be correct TMX files and can either contain only textual information (level 1 TMX), OmegaT textual and formatting information (omegat TMX) or TMX textual and formatting information (level 2 TMX). The differences between them are technical (see below for details), and if you wish to use a translation memory from a past project, they are largely interchangeable, i.e. they will all work equally well.

Optionally, you can let OmegaT make an additional TMX file (OmegaT-style) anywhere you specify, containing all translateable segments of the project. See pseudo-translated memory.

### TMX backup

When you translate your files, OmegaT stores all your progress in translation memory in the project's /omegat subdirectory.

OmegaT also backups translation memory to project_save.tmx.YEARMMDDHHNN.bak in the same subfolder every time when a project is opened or reloaded. YEAR is 4-digit year, MM is a month, DD day of the month, HH and NN are hours and minutes when the previous translation memory was saved.

If you think you have lost translation data follow this procedure:

1. close the project
2. rename the current project_save.tmx file to something you will remember (like project_save.tmx.temporary for example)
3. select the backup translation memory that is the most likely to contain the data you are looking for
4. rename it to project_save.tmx
5. open the project

### TMX files and language

TMX files contain translation units that are made of a number of equivalent segments in different languages. A translation unit is made of at least two translation unit variations (tuv). Either can be used as source or target.

The settings in your project will indicate which is the source language and which is the target language. OmegaT will thus take the tuv corresponding to the project source language code and use that segment as the source segment, and it will take the tuv corresponding to the project target language code and use that segment as the target segment. OmegaT recognizes them using the following two standard conventions:

- 2 letters (e.g. JA for Japanese), or
- 2-letter language code followed by the 2-letter country code (e.g. EN-US)

See Languages for a partial list of language and country codes.

If the project language codes and the TMX language codes fully match, the segments are loaded in memory. If the codes match only the language but not the country, the segments are also loaded in memory. If neither the language code not the country code match, the segments are not loaded in memory.

## How OmegaT remembers your translations

The file project_save.tmx contains all the segments that have been memorized since you started the project. If you do any modification on the project segmentation for example, project_save.tmx will record new translation pairs but will retain all the previous information.

This will occasionally lead to the display of orphan strings in the Match Viewer. Such matches no longer refer to segments existing in the source documents, but to segments recorded before the modifications took place. If the modification was a mistake, revert to the previous settings and the older recordings will reappear.

## Using translation memories from previous projects

When you create the target documents in an OmegaT project, the translation memory of the project is output in the form of three files in the root folder of your OmegaT project (see the above description). You can regard these three TMX files (-omegat.tmx", "-level1.tmx" and "-level2.tmx") as an "export translation memory", i.e. as an exportable bilingual summary of your current project.

Should you wish to reuse a translation memory from a previous project (for example because the new project is similar to the previous project, or uses terminology which might have been used before), you can use these translation memories as "input translation memories", i.e. for import into your new project. In this case, place the translation memories you wish to use in the \tm folder of your new project.

By default, the \tm folder is below the project's root folder (e.g. ..\MyProject\tm), but you can choose a different folder in the project properties dialog if you wish. This is useful if you frequently use translation memories produced in the past, for example because they are on the same subject or for the same customer. In this case, a useful procedure would be:

- Create a folder (a "repository folder") in a convenient location on your hard drive for the translation memories for a particular customer or subject.
- Whenever you finish a project, copy one of the three "export" translation memory files from the root folder of the project to the repository folder.
- When you begin a new project on the same subject or for the same customer, navigate to the repository folder in the Project > Properties > Edit Project dialog and select it as the translation memory folder.

Note that all the TMX files in the /tm repository get parsed during the startup of the program, so putting in all the TMX files you can get your hands on will unnecessarily slow down OmegaT. You may even consider eliminating those that are strictly necessary (for example by leaving them in the /tm subdirectory, but changing their extension), once their contents have migrated to the project_save.tmx of your current project.

## Using memories created by other translation tools

### Importing files

OmegaT supports importing TMX versions 1.1-1.4b (both level 1 and level 2). This enables the translation memories produced by other tools to be read by OmegaT. However, OmegaT does not fully support imported level 2 TMX files (that store not only the translation, but also the formatting), so the quality of fuzzy matches will be a bit lower when importing level 2 TMX files.

### Imported files handling

OmegaT follows very strict procedures when handling translation memory files (TMX files). If any mistake is found in such a file, OmegaT will simply not load it.

Some tools are known to produce invalid TMX files in certain conditions. If you want to use such files as reference translations in OmegaT, they will need to be fixed if OmegaT refuses them. Fixes are trivial operations and OmegaT will give you indications in the related error message. You can ask the user group for advice if you have problems.

## Using OmegaT translation memories in other translation tools

OmegaT exports TMX files version 1.4 (both level 1 and level 2). The level 2 export is not a standard level 2 but is enough to generate correct matches in TMX Level 2 supporting translation tools. If you only need textual information (and not formatting information), use the level 1 file that OmegaT has created.

## Pseudo-translated memory

There might be a case in which you want to do pre-processing or other processing of the segments than OmegaT allows. For example you want to create a pseudo-translation for testing purposes.

OmegaT allows you to create an extra tmx file that contains all segments of the project. The translation in this tmx can be either

- translation equals source (default)
- translation segment is empty

The tmx file can get any name you specify, but the extension '.tmx' is added if not given.

The generation is activated in console mode. See console mode how to do this.

You can process the generated tmx with any tool you want. To reuse it in OmegaT:
rename it to project_save.tmx and put it in the omegat-folder of your project.

## Upgrading translation memories

Previous versions of OmegaT were capable of segmenting source files into paragraphs only, and were inconsistently numbering formatting tags in HTML and Open Document files. OmegaT 2.0 can detect and upgrade such TMX files on the fly to increase fuzzy matching quality and leverage your existing translation better -- so that you don't have to redo it.

A project's TMX will be upgraded only once, and will be written in upgraded form, and legacy TMX files will be upgraded on the fly each time the project is loaded. Note that some changes in file filters in OmegaT 2.0 may lead to totally different segmentation, thus in rare cases you will have to upgrade your translation manually.

Legal notices | Home | Index of contents