What is TMX?
TMX (Translation Memory eXchange) is an open XML standard designed for exchanging translation memory (TM) data between different CAT tools and localization systems. Developed by LISA (Localization Industry Standards Association), TMX enables organizations to share and migrate translation assets regardless of the software they use.
TMX has become the de facto standard for TM interchange, supported by virtually all CAT tools in the industry.
TMX Versions
TMX 1.1 (1998)
The original specification, establishing basic structure.
TMX 1.4 (2004)
The most widely supported version:
- Improved metadata handling
- Better character encoding support
- Enhanced segment-level properties
- Still the most common version in production
TMX 2.0 (Draft)
Proposed updates that were never finalized due to LISA's dissolution.
TMX Structure
Basic Structure
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tmx SYSTEM "tmx14.dtd">
<tmx version="1.4">
<header
creationtool="KTTC"
creationtoolversion="1.0"
datatype="plaintext"
segtype="sentence"
adminlang="en"
srclang="en"
o-tmf="KTTC"/>
<body>
<tu>
<tuv xml:lang="en">
<seg>Hello, world!</seg>
</tuv>
<tuv xml:lang="de">
<seg>Hallo, Welt!</seg>
</tuv>
</tu>
</body>
</tmx>
Key Elements
| Element | Description |
|---|---|
<tmx> | Root element with version attribute |
<header> | Metadata about the TM |
<body> | Container for translation units |
<tu> | Translation Unit (source + translations) |
<tuv> | Translation Unit Variant (one language) |
<seg> | Actual segment text |
<prop> | Custom properties |
<note> | Comments and notes |
Header Attributes
<header
creationtool="CAT Tool Name"
creationtoolversion="3.0"
datatype="plaintext"
segtype="sentence"
adminlang="en"
srclang="en-US"
o-tmf="native-format">
</header>
| Attribute | Description |
|---|---|
creationtool | Name of the creating application |
creationtoolversion | Version of the creating application |
datatype | Data type (plaintext, html, xml, etc.) |
segtype | Segmentation type (sentence, paragraph, phrase) |
adminlang | Administrative language |
srclang | Source language code |
o-tmf | Original TM format |
Translation Unit (TU) Details
Basic TU
<tu tuid="001" creationdate="20241220T120000Z">
<tuv xml:lang="en">
<seg>Welcome to our platform.</seg>
</tuv>
<tuv xml:lang="fr">
<seg>Bienvenue sur notre plateforme.</seg>
</tuv>
</tu>
TU with Metadata
<tu
tuid="002"
creationdate="20241220T120000Z"
creationid="translator1"
changedate="20241221T150000Z"
changeid="reviewer1"
lastusagedate="20241222T100000Z"
usagecount="5">
<prop type="domain">legal</prop>
<prop type="project">Contract Translation</prop>
<prop type="client">Acme Corp</prop>
<note>Approved by legal team</note>
<tuv xml:lang="en">
<seg>This agreement shall be governed by...</seg>
</tuv>
<tuv xml:lang="de">
<seg>Diese Vereinbarung unterliegt...</seg>
</tuv>
</tu>
Multilingual TU
<tu tuid="003">
<tuv xml:lang="en">
<seg>Save</seg>
</tuv>
<tuv xml:lang="de">
<seg>Speichern</seg>
</tuv>
<tuv xml:lang="fr">
<seg>Enregistrer</seg>
</tuv>
<tuv xml:lang="es">
<seg>Guardar</seg>
</tuv>
</tu>
Inline Elements
TMX supports inline elements for preserving formatting:
Common Inline Tags
| Tag | Purpose | Example |
|---|---|---|
<bpt> | Begin paired tag | <bpt i="1"><b></bpt> |
<ept> | End paired tag | <ept i="1"></b></ept> |
<ph> | Placeholder | <ph>{0}</ph> |
<it> | Isolated tag | <it><br/></it> |
<hi> | Highlight | <hi>term</hi> |
<ut> | Unknown tag | For unrecognized markup |
Example with Formatting
<tu>
<tuv xml:lang="en">
<seg>Click the <bpt i="1"><b></bpt>Save<ept i="1"></b></ept> button.</seg>
</tuv>
<tuv xml:lang="de">
<seg>Klicken Sie auf die Schaltfläche <bpt i="1"><b></bpt>Speichern<ept i="1"></b></ept>.</seg>
</tuv>
</tu>
Language Codes
TMX uses BCP 47 / ISO language codes:
| Code | Language |
|---|---|
| en | English (general) |
| en-US | English (United States) |
| en-GB | English (United Kingdom) |
| de | German (general) |
| de-DE | German (Germany) |
| de-AT | German (Austria) |
| fr | French (general) |
| zh-CN | Chinese (Simplified) |
| zh-TW | Chinese (Traditional) |
| ru | Russian |
| ja | Japanese |
| ko | Korean |
Best Practices
Creating TMX Files
Use UTF-8 Encoding
- Always specify
encoding="UTF-8" - Avoid legacy encodings
- Always specify
Include Metadata
- Set creation date
- Include creator information
- Add domain/project properties
Consistent Language Codes
- Use standard BCP 47 codes
- Be consistent with regional variants
Validate Before Export
- Check XML well-formedness
- Validate against TMX DTD
Importing TMX
Check Encoding
- Verify file encoding matches declaration
- Handle BOM if present
Handle Duplicates
- Define duplicate resolution strategy
- Consider source text + context
Map Language Codes
- Handle variant mappings (en vs en-US)
- Document any transformations
TMX Quality
| Issue | Solution |
|---|---|
| Encoding errors | Convert to UTF-8 |
| Missing language codes | Add xml:lang attributes |
| Invalid XML | Validate and fix structure |
| Duplicate TUs | Merge or deduplicate |
| Missing metadata | Add header information |
TMX vs Other Formats
TMX vs XLIFF
| Aspect | TMX | XLIFF |
|---|---|---|
| Purpose | TM exchange | Document localization |
| Focus | Segment pairs | Full workflow |
| Content | Finalized translations | In-progress work |
| Metadata | TM-specific | Workflow-specific |
TMX vs TBX
| Aspect | TMX | TBX |
|---|---|---|
| Content | Segment pairs | Terminology entries |
| Structure | Source + Target | Terms + definitions |
| Use case | Translation reuse | Term consistency |
Common Issues and Solutions
Character Encoding
Problem: Special characters appear corrupted. Solution: Ensure UTF-8 encoding and proper XML escaping.
<!-- Correct escaping -->
<seg>Price: <$100 & free shipping</seg>
Large File Handling
Problem: TMX files too large to process. Solutions:
- Split by language pair
- Split by project/domain
- Use streaming XML parsers
Version Compatibility
Problem: Different tools support different TMX versions. Solution: Export as TMX 1.4b for maximum compatibility.
FAQ
What is the difference between TMX and TM?
TM (Translation Memory) is the database of translations, while TMX is the file format used to export and exchange that data between different systems.
Can TMX store multiple language pairs?
Yes, a single TMX file can contain translations in multiple languages. Each TU can have multiple TUV elements for different target languages.
What's the maximum size for a TMX file?
There's no technical limit, but very large files (millions of TUs) may cause performance issues. It's recommended to split files larger than 100MB.
How do I convert between TMX versions?
Most CAT tools handle version conversion automatically during import/export. For manual conversion, ensure all required elements are present for the target version.
Is TMX still the industry standard?
Yes, TMX 1.4b remains the most widely supported format for TM exchange. While XLIFF is used for project files, TMX is the standard for TM data interchange.
Can TMX preserve formatting?
Yes, using inline elements (bpt, ept, ph, it) to represent formatting tags. However, the specific handling varies between CAT tools.
