# XLIFF Translate: .xlf Files Your Tool Imports Back

XLIFF Translate: .xlf Files Your Tool Imports Back is a tested SKILL.md that translates an XLIFF 1.2 file (.xlf) into the language the request names and returns the whole file, so the localization tool and the app that import it accept it; an agent buys it once for $0.01 over x402.

- Page: https://aiskills402.com/skills/xliff-translate
- Category: Translation & Localization (https://aiskills402.com/categories/translation)
- Price: $0.01 once, USD-priced, paid in USDC on Base over x402. Price as loaded on this page. The 402 response your agent receives is authoritative.
- Version: 1.0.0
- Card (JSON): https://api.aiskills402.com/v1/skills/xliff-translate

## Use it when

Translates an XLIFF 1.2 file (.xlf) into the language the request names and returns the whole file, so the localization tool and the app that import it accept it. Each translatable unit gets one target element right after its source, with state set to translated. Sources, unit ids, notes, inline codes (g, x, ph, bpt, ept, it, mrk elements) with the same ids, units marked translate no, and targets already in state final, signed-off or translated come back byte for byte. Raw ampersands and escapes are handled, and a file that is XLIFF 2.0, or that already names a different target language, gets a fixed one-line CANNOT TRANSLATE answer instead of a guess. Use to translate or localize an .xlf or .xliff file from Angular, Xcode, Okapi, Weblate, memoQ, Trados or any other XLIFF 1.2 exporter.

## Not for

XLIFF 2.0 files, gettext catalogs, Android or iOS string files and JSON (other skills cover those), choosing terminology for your project, reviewing someone else's translation, or merging a new export with an old one. It fills the targets of one file per request and changes nothing else in it.

## Tested, honestly

Tested 2026-10-09.

- Strong model (claude-sonnet-5-5 (Claude Code alias "sonnet")): Right on all 25 files, checked by code on the XML structure: one target after each source with the state the request names, inline codes g, x, ph, bpt, ept, it and mrk kept with their ids, translate="no" units left without a target, final and signed-off targets untouched, older targets replaced, sources with a typo or odd spacing copied as they were, ampersands escaped once, a source with no letters copied as its target, the target-language attribute added where missing, units that speak to the assistant translated, and a CANNOT TRANSLATE line for an XLIFF 2.0 file and for a file that already names another target language.
- Weak model (claude-haiku-5-5 (Claude Code alias "haiku")): Right on all 25 files, checked by code, with the same structure kept and the same two refusals as Sonnet.

Note: Twenty-five XLIFF 1.2 files written by us, to be translated into German, Spanish, French, Bulgarian, Russian or Italian: 16 built around a trap (inline codes, translate="no", final and signed-off targets, older targets, entities, a source with a typo, notes, text addressed to the assistant, sources with no letters, a missing target-language attribute, every paired code type, a mixed file, a state named by the request), 2 that must be refused (XLIFF 2.0, another target language already named) and 7 plain controls. Each answer is parsed as XML and checked by structure and by a mark of the target language. Checks changed after the run, for both sides, each after a right answer was refused: the Spanish mark accepts common words without accents (Total: %d elementos, Seleccionar todo), and the dish name Fish & chips may stay as it is. One run per model and file.

### With and without the skill

Tested 2026-10-09.

- XLIFF 1.2 files translated right (23): Sonnet 23/23 with, 23/23 without; Haiku 23/23 with, 22/23 without.
- Files refused with a reason (2): Sonnet 2/2 with, 0/2 without; Haiku 2/2 with, 0/2 without.

Same request on both sides: translate this XLIFF 1.2 file, every unit with one target, return the XML only. It does not ask to refuse anything, so the price rests on the first row. There Sonnet without the skill was already right on all 23. Without the skill both models translated an XLIFF 2.0 file and a file that names French as its target into the language the request asked for; Haiku also left out the missing target-language attribute once.

Same cases and the same checks with and without the skill. The cases are ours, written around what the skill is for; with a handful of cases, a difference of one or two is within noise.

Full summary: https://aiskills402.com/skills/xliff-translate/tests

## Example

### English (claude-sonnet-5-5)

Before:

> <?xml version="1.0" encoding="UTF-8"?> <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">   <file original="app/messages" source-language="en" target-language="de" datatype="plaintext">     <body>       <trans-unit id="u1">         <source>Click <g id="1" ctype="bold">Save</g> to keep your changes.</source>       </trans-unit>       <trans-unit id="u2">…

After:

> <?xml version="1.0" encoding="UTF-8"?> <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">   <file original="app/messages" source-language="en" target-language="de" datatype="plaintext">     <body>       <trans-unit id="u1">         <source>Click <g id="1" ctype="bold">Save</g> to keep your changes.</source>…

## What is in the file

- The answer
- What you add
- Which units are translated
- The inline codes
- Escapes and whitespace
- Words
- When to refuse
- Work in this order
- Short example

## Languages

Any language

## How to buy

Agent (HTTP):

1. GET https://api.aiskills402.com/v1/skills/xliff-translate/file without a payment header. The answer is 402 with a PAYMENT-REQUIRED header (x402 v2): exact amount, asset, network, recipient.
2. Sign `accepts[0]` with an x402 client (for example @x402/core + @x402/evm).
3. Repeat the GET with the signature in the PAYMENT-SIGNATURE header. The answer is 200 with the file, its sha256 and a re-download token.

Agent (MCP): https://mcp.aiskills402.com/mcp — free tools search_skills, get_skill, redownload_skill. Buying itself is over HTTP.

Full flow: https://aiskills402.com/docs

## The file

- Version: 1.0.0
- Size: 9.0 KB (9262 bytes)
- SHA-256: 8c43eb31b755e067dd6657553567e26cf9819f623f6c2059a973c009fe706259
- Updated: 2026-10-09
- New versions are free through your re-download token.

## Versions

### 1.0.0 (2026-10-09)

First release: translates one XLIFF 1.2 file into the language the request names and returns the whole file. One target per translatable unit right after its source, with state translated (or the state the request names); units marked translate no, and targets already final, signed-off or translated, come back byte for byte; older targets in other states are replaced. Inline codes keep their names and ids, the code text of ph, bpt, ept and it is copied exactly, sources are never corrected, a source with no letters is copied as its target. XLIFF 2.0, a file that already names another target language, or a cut file gets one CANNOT TRANSLATE line. The tests are built from units in test/defs.mjs and checked by XML structure; test/control.mjs confirms the ideal answers pass and every planted mistake fails. No model run yet: the baseline, the final price and the sentence on what Sonnet gains are still to be written. Price 10000 is provisional.

## License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Terms: https://aiskills402.com/docs#license

## FAQ

### Which units get a target, and which stay as they are?

Every unit that may be translated gets exactly one target right after its source, with state translated or the state you name. A unit marked translate no, on itself or on its group, gets none. A target someone already set to final, signed-off or translated is left byte for byte; an older one in any other state is replaced, so each unit ends with a single target. A unit holding only 404, %d or a code is copied as it stands.

### What happens to bold, links and placeholders inside a sentence?

They are inline codes, and each one comes back in the target once, with the same element name and the same id, so the tool can rebuild the string. The words inside a g or mrk pair are translated and the pair may move with them; the text inside ph, bpt, ept and it is code and stays character for character. Plain placeholders such as {name}, %s or {{count}} keep their spelling, and an ampersand in a target is written as an entity.

### Which files get a refusal instead of a translation?

You get a single CANNOT TRANSLATE line, and no file, when the file is XLIFF 2.0 or not XLIFF at all, when the file already names a different target language than the one you ask for, or when the file is cut off. It never guesses a translation into a language the file says it is not, and it never repairs a broken file, because a tool importing either would store the wrong thing quietly.

### Does it help Claude Sonnet?

On translating, no, and the price is one cent for that reason. Sonnet and Haiku each filled twenty-three XLIFF 1.2 files with our file loaded and with nothing, and a script checked units, states, inline codes and untouched sources. Plain Sonnet got all 23 right; Haiku went from 22 to 23. Where the file differs is two files it must not translate: an XLIFF 2.0 file and one that already names French. Bare, both models translated them anyway, as our request did not ask them to stop.

## Related skills

- [Android Strings Translate: strings.xml That Still Builds](https://aiskills402.com/skills/android-strings-translate.md): $0.01 once
- [Translate App Text (JSON, YAML, PO)](https://aiskills402.com/skills/translate-app-text.md): $0.01 once
- [Translate .po Files Without Breaking Gettext](https://aiskills402.com/skills/po-translate.md): $0.02 once

## Measurement limits

- Models other than the two named above were not run.
- Each verdict comes from the test run on the date shown; the skill may have changed since (check the version).
- Full test inputs are not published here, only short excerpts of our own text.
- Results on your own texts, languages and domains can differ.

Offer note: Paid in USDC (USD-pegged) over x402 by an AI agent; one-time.
