Ai mt deepl pro post editing

From CraftOS-dev/craftbot-agent-bundles · View interactive version

Ai mt deepl pro post editing is an AI agent skill from the GitHub repository CraftOS-dev/craftbot-agent-bundles. AI machine translation + post-editing workflows. DeepL Pro (European leader), Google Translate (breadth), Amazon Translate (cheap), ModernMT (adaptive), Lilt (adaptive+human). Document API, glossaries, formality control. Use when the user asks "translate this with DeepL", "compare MT engines", "set

How to use this skill

Skill file

AI / MT Post-Editing — DeepL Pro / Google / Amazon / ModernMT / Lilt

DeepL leads quality on European pairs (top in 65% per Intento benchmark). Google leads breadth (249+ languages). Amazon is cheapest ($15/M chars). ModernMT learns from corrections in real time. Lilt bundles adaptive MT + human reviewer.

Post-Editing Machine Translation (PEMT) is being replaced by adaptive MT — 71% of linguists prefer adaptive over static PEMT in 2026.

When to use

Trigger phrases: "DeepL", "translate this catalog", "MT engine", "post-editing", "PEMT", "adaptive MT", "ModernMT", "Lilt", "Document API".

Setup

# DeepL — via MCP (preferred) or REST
# MCP: see app/config/mcp_config.json → deepl-mcp

# DeepL REST
curl -X POST 'https://api.deepl.com/v2/translate' \
  -H "Authorization: DeepL-Auth-Key $DEEPL_API_KEY" \
  -d 'text=Hello&target_lang=DE'

# Google Cloud Translation
pipx install google-cloud-translate

# Amazon Translate (via AWS CLI)
pipx install awscli
aws translate translate-text --source-language-code en --target-language-code de --text "Hello"

# ModernMT
# REST — no SDK install needed
# pip install modernmt-python  # community SDK

# Lilt — enterprise REST API
# No SDK; use curl

Auth/env:

Engine comparison (2026)

| Engine | Quality (EU pairs) | Languages | Price (per 1M chars) | Adaptive | Document API |

|---|---|---|---|---|---|

| DeepL Pro | Top in 65% | 100+ | $20-25 | No | Yes (DOCX/PDF/HTML/PPTX) |

| Google Translate | Strong | 249+ | $20 (≤500k free) | No | Yes |

| Amazon Translate | Decent | 80+ | $15 | Custom-trained | Yes |

| Azure Translator | Strong | 130+ | $10 | Custom-trained | Yes |

| ModernMT | Strong + adaptive | 200+ | $10-40 | Yes (real-time) | Limited |

| Lilt | Strong + adaptive | 60+ | Enterprise | Yes + human | Limited |

| memoQ AGT | Best with TM/TB | 50+ | Bundled | Yes (LLM) | Via memoQ |

Common recipes

Recipe 1: DeepL REST — single string

curl -X POST 'https://api.deepl.com/v2/translate' \
  -H "Authorization: DeepL-Auth-Key $DEEPL_API_KEY" \
  -d 'text=Save your work before closing.' \
  -d 'target_lang=DE' \
  -d 'formality=more' \
  -d 'preserve_formatting=1' \
  -d 'tag_handling=html'

Returns:

{"translations":[{"detected_source_language":"EN","text":"Speichern Sie Ihre Arbeit, bevor Sie sie schließen."}]}

Recipe 2: DeepL with glossary

# Create glossary
curl -X POST 'https://api.deepl.com/v2/glossaries' \
  -H "Authorization: DeepL-Auth-Key $DEEPL_API_KEY" \
  -d 'name=brand-en-de' \
  -d 'source_lang=EN' \
  -d 'target_lang=DE' \
  -d 'entries_format=csv' \
  --data-urlencode 'entries=API,API
SDK,SDK
endpoint,Endpunkt'
# → returns {"glossary_id": "abc123..."}

# Use on translate
curl -X POST 'https://api.deepl.com/v2/translate' \
  -H "Authorization: DeepL-Auth-Key $DEEPL_API_KEY" \
  -d 'text=Connect to the API endpoint.' \
  -d 'target_lang=DE' \
  -d 'glossary_id=abc123...'

Recipe 3: DeepL Document API (DOCX, PDF, HTML)

# Upload document
RESPONSE=$(curl -X POST 'https://api.deepl.com/v2/document' \
  -H "Authorization: DeepL-Auth-Key $DEEPL_API_KEY" \
  -F 'file=@whitepaper.docx' \
  -F 'target_lang=DE' \
  -F 'formality=more')
DOC_ID=$(echo $RESPONSE | jq -r '.document_id')
DOC_KEY=$(echo $RESPONSE | jq -r '.document_key')

# Poll status
curl "https://api.deepl.com/v2/document/$DOC_ID" \
  -H "Authorization: DeepL-Auth-Key $DEEPL_API_KEY" \
  -d "document_key=$DOC_KEY"

# Download when status = "done"
curl -X POST "https://api.deepl.com/v2/document/$DOC_ID/result" \
  -H "Authorization: DeepL-Auth-Key $DEEPL_API_KEY" \
  -d "document_key=$DOC_KEY" \
  -o whitepaper-de.docx

Document API preserves all formatting — fonts, images, tables, paragraph styles.

Recipe 4: DeepL via MCP

// MCP tool: deepl-mcp exposes `translate`, `translate_document`, `glossary_*`
// Call from agent:
await tools.deepl.translate({
  text: 'Save your work.',
  target_lang: 'DE',
  formality: 'more',
  tag_handling: 'html',
  glossary_id: 'abc123...'
});

Recipe 5: Google Translate v3 — batch

gcloud auth application-default login

curl -X POST "https://translation.googleapis.com/v3/projects/$PROJECT/locations/global:translateText" \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json" \
  -d '{
    "sourceLanguageCode": "en",
    "targetLanguageCode": "de",
    "contents": ["Hello", "World", "Save your work"]
  }'

Recipe 6: Amazon Translate — batch via S3

aws translate start-text-translation-job \
  --job-name release-2026Q3 \
  --source-language-code en \
  --target-language-codes de fr ja \
  --input-data-config S3Uri=s3://bucket/sources/,ContentType=text/plain \
  --output-data-config S3Uri=s3://bucket/output/ \
  --data-access-role-arn arn:aws:iam::123:role/translate

aws translate describe-text-translation-job --job-id <JOB_ID>

Recipe 7: ModernMT — adaptive translation

# Translate (uses learned corrections)
curl 'https://api.modernmt.com/translate' \
  -H "MMT-ApiKey: $MODERNMT_API_KEY" \
  -d 'source=en' \
  -d 'target=de' \
  -d 'q=Save your work' \
  -d 'priority=normal'

# Feedback — train the engine
curl -X PUT 'https://api.modernmt.com/memories/<MEM_ID>/content' \
  -H "MMT-ApiKey: $MODERNMT_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "source": "en",
    "target": "de",
    "sentence": "Save your work",
    "translation": "Speichern Sie Ihre Arbeit"
  }'
# Next translation gets the correction

Recipe 8: Lilt adaptive translation

curl -X POST 'https://api.lilt.com/v2/translate' \
  -H "Authorization: Basic $(echo -n :$LILT_API_KEY | base64)" \
  -H 'Content-Type: application/json' \
  -d '{
    "source": "Save your work before closing.",
    "source_lang": "en",
    "target_lang": "de",
    "memory_id": <MEMORY_ID>
  }'

# Submit corrected translation back to memory
curl -X POST "https://api.lilt.com/v2/memories/<MEM_ID>/segments" \
  -H "Authorization: Basic $(echo -n :$LILT_API_KEY | base64)" \
  -d '{
    "source": "Save your work before closing.",
    "target": "Speichern Sie Ihre Arbeit, bevor Sie schließen."
  }'

Recipe 9: PEMT (Post-Editing MT) workflow

1. Source segment → MT engine → raw MT
2. Translator opens in CAT (memoQ / Trados / Phrase TMS)
3. Edits raw MT to final translation
4. CAT counts post-edit effort (PED — % of segment changed)
5. Final segment → TM
6. If adaptive MT (ModernMT / Lilt): correction back to engine

PED categories:

Recipe 10: Bulk JSON catalog translation

# Translate entire en.json → de.json via DeepL
jq -r 'to_entries[] | "\(.key)|\(.value)"' en.json | while IFS='|' read -r key val; do
  translated=$(curl -s -X POST 'https://api.deepl.com/v2/translate' \
    -H "Authorization: DeepL-Auth-Key $DEEPL_API_KEY" \
    --data-urlencode "text=$val" \
    -d 'target_lang=DE' \
    -d 'formality=more' \
    | jq -r '.translations[0].text')
  echo "  \"$key\": \"$translated\","
done > de.json.partial

Better — use Crowdin / Phrase / Lokalise's built-in MT pre-translate (handles ICU correctly).

Recipe 11: TMS-integrated MT pre-translate

# Crowdin
crowdin pre-translate --languages de,fr,ja --method mt --auto-approve-imported \
  --apply-untranslated-strings-only

# Phrase
phrase pre_translate \
  --target-locale-ids <LOC_ID> --machine-translate-settings-id <MT_ID>

# Lokalise — auto-translate via UI or:
lokalise2 translation upload \
  --token "$LOKALISE_API_TOKEN" --project-id $PID \
  --use-auto-translation --filter-data='untranslated'

Recipe 12: Quality estimation (which MT segments need PE)

DeepL returns confidence; ModernMT scores per segment. Triage by score:

# Pseudocode
for seg in raw_mt:
    if seg.confidence > 0.95:
        seg.status = 'auto-approve'    # ship as-is
    elif seg.confidence > 0.85:
        seg.status = 'spot-review'     # sample 10% review
    else:
        seg.status = 'full-PE'         # translator edits

Recipe 13: Glossary auto-build from TM

# Extract high-frequency source terms → seed glossary
python -c "
import json, collections
en = json.load(open('locales/en.json'))
words = collections.Counter()
for v in en.values():
    words.update(v.split())
common = [w for w, c in words.most_common(200) if len(w) > 3]
print('\n'.join(common))
" > candidate-terms.txt
# Human review → upload to DeepL glossary

Recipe 14: Formality control (DeepL)

# DeepL formality params (DE/FR/ES/IT/JA/RU/NL/PT/PL support)
curl ... -d 'formality=more'       # formal (Sie / vous)
curl ... -d 'formality=less'       # informal (du / tu)
curl ... -d 'formality=default'    # MT decides

JA: formality=more produces です/ます; less produces だ/である.

Recipe 15: Compare engines on user pairs

# Quick QC: same source → 3 engines → human ranks
SRC="Save your work before closing the application."
for ENG in deepl google amazon; do
  case $ENG in
    deepl) curl -s 'https://api.deepl.com/v2/translate' -H "Authorization: DeepL-Auth-Key $DEEPL_API_KEY" -d "text=$SRC" -d 'target_lang=DE' | jq -r '.translations[0].text' ;;
    google) gcloud translate --target=de --source=en "$SRC" ;;
    amazon) aws translate translate-text --source-language-code en --target-language-code de --text "$SRC" | jq -r '.TranslatedText' ;;
  esac
  echo "  ↑ $ENG"
done

Examples

Example 1: Translate 5k UI strings into 6 locales with DeepL Pro

Goal: Initial bulk MT pre-translation; human reviewers edit afterwards.

Steps:

  1. Push source en.json to Crowdin (or use direct DeepL API).
  2. Create DeepL glossary for brand terms (Recipe 2): "API", "SDK", "CraftBot" → DNT.
  3. Run Crowdin MT pre-translate (Recipe 11) with DeepL engine + glossary.
  4. Set strings to "needs review" status.
  5. In-country reviewer opens Crowdin, edits MT to final translation.
  6. CI pulls approved translations (Recipe download --export-only-approved).
  7. Cost: 5000 strings × 50 chars × 6 locales = 1.5M chars × $0.025 = ~$37.50.

Result: Initial pre-translation in hours, not weeks; PED ~20-30% across locales.

Example 2: Translate a 50-page DOCX whitepaper preserving formatting

Goal: Sales whitepaper in EN → DE/FR/ES with intact formatting (fonts, tables, images).

Steps:

  1. Upload to DeepL Document API (Recipe 3) per target locale.
  2. Poll status — each doc takes 2-10 min.
  3. Download translated DOCX.
  4. Open in Word → spot-check tables, captions, footers — formatting preserved.
  5. Send to in-market reviewer for final edit pass.

Result: No manual formatting recovery; reviewer focuses on language, not layout.

Example 3: Adaptive MT loop with ModernMT for support docs

Goal: Support docs translated DE/FR over 6 months; want engine to learn brand voice.

Steps:

  1. Initial batch translated with ModernMT (Recipe 7).
  2. Translator edits final strings in TMS.
  3. CI script POSTs corrected segments back to ModernMT memory (Recipe 7 feedback).
  4. After 1000 corrections, batch 2 MT quality measurably improves (lower PED).
  5. After 5000 corrections, batch 5 MT is near-shippable for low-stakes segments.

Result: Per-segment translation effort drops 30-50% over project lifetime.

Edge cases / gotchas

Sources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.