Overview
Translation memory (TM) is a database of previously translated text segments. When new content arrives for translation, Translate searches the TM for similar segments and provides suggestions with confidence scores. This ensures terminological consistency across documents and reduces translation costs by reusing validated translations.
How It Works
Every completed translation is stored as a TM entry containing the source text, translated text, source language, target language, and domain. When a new translation request arrives, the engine:
- Segments the input text
- Searches the TM for fuzzy matches against each segment
- Returns matches above the confidence threshold with their similarity scores
- Uses high-confidence matches directly, and sends low-confidence segments to the AI model
This hybrid approach combines the consistency of human-validated TM entries with the flexibility of AI translation for new content.
Managing TM Entries
Create an Entry
Add a verified translation pair to the memory:
curl -X POST http://localhost:8012/api/v1/translation-memory \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"source_text": "Ministry of Finance",
"target_text": "وزارة المالية",
"source_lang": "en",
"target_lang": "ar",
"domain": "administrative"
}'
List Entries
Browse TM entries with filtering:
curl "http://localhost:8012/api/v1/translation-memory?source_lang=en&target_lang=ar&domain=legal&page=1&page_size=20" \
-H "Authorization: Bearer $TOKEN"
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
source_lang | string | Filter by source language |
target_lang | string | Filter by target language |
domain | string | Filter by domain |
search | string | Full-text search across source and target text |
page | integer | Page number (default: 1) |
page_size | integer | Results per page (default: 20, max: 100) |
Update an Entry
Correct a TM entry when a translation needs revision:
curl -X PUT http://localhost:8012/api/v1/translation-memory/{entry_id} \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"target_text": "وزارة الماليّة"
}'
Delete an Entry
Remove a TM entry (requires admin role):
curl -X DELETE http://localhost:8012/api/v1/translation-memory/{entry_id} \
-H "Authorization: Bearer $TOKEN"
TMX Import/Export
Translation Memory eXchange (TMX) is the industry-standard XML format for exchanging translation memories between tools. Translate supports both import and export.
Export TMX
Export your TM as a TMX file, optionally filtered by language pair and domain:
curl "http://localhost:8012/api/v1/translation-memory/export?source_lang=en&target_lang=ar&domain=legal" \
-H "Authorization: Bearer $TOKEN" \
-o legal_memory.tmx
The response is an application/xml file with Content-Disposition: attachment.
Import TMX
Import a TMX file to bulk-load translation memory entries (requires admin role):
curl -X POST http://localhost:8012/api/v1/translation-memory/import \
-H "Authorization: Bearer $TOKEN" \
-F "file=@legal_memory.tmx"
Only .tmx and .xml files are accepted. Each translation unit in the TMX file becomes a TM entry.
Migration
TMX import enables migration from existing CAT tools (SDL Trados, memoQ, OmegaT) into Translate. Export your existing TM as TMX and import it directly.
Fuzzy Matching
When the TM contains a segment that is similar but not identical to the input, Translate returns it as a fuzzy match with a similarity score (0.0 to 1.0). Scores above 0.85 are typically reliable enough for direct reuse; lower scores serve as reference suggestions that may need human review.
Fuzzy matching accounts for minor variations in word order, punctuation, and formatting while maintaining strict matching for domain-specific terminology.