{"slug":"xliff-translate","name":"XLIFF Translate: .xlf Files Your Tool Imports Back","version":"1.0.0","updated_at":"2026-10-09T04:21:22.778Z","use_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.","languages":["any"],"tags":["translation","xliff","localization","xlf","inline-codes","i18n"],"category":"translation","category_url":"https://aiskills402.com/categories/translation","keywords":["localize an .xlf",".xliff file","XLIFF 1.2 exporter"],"faq":[{"q":"Which units get a target, and which stay as they are?","a":"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."},{"q":"What happens to bold, links and placeholders inside a sentence?","a":"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."},{"q":"Which files get a refusal instead of a translation?","a":"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."},{"q":"Does it help Claude Sonnet?","a":"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."}],"examples":[{"lang":"en","model":"claude-sonnet-5-5","input_excerpt":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xliff version=\"1.2\" xmlns=\"urn:oasis:names:tc:xliff:document:1.2\">\n  <file original=\"app/messages\" source-language=\"en\" target-language=\"de\" datatype=\"plaintext\">\n    <body>\n      <trans-unit id=\"u1\">\n        <source>Click <g id=\"1\" ctype=\"bold\">Save</g> to keep your changes.</source>\n      </trans-unit>\n      <trans-unit id=\"u2\">…","output_excerpt":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xliff version=\"1.2\" xmlns=\"urn:oasis:names:tc:xliff:document:1.2\">\n  <file original=\"app/messages\" source-language=\"en\" target-language=\"de\" datatype=\"plaintext\">\n    <body>\n      <trans-unit id=\"u1\">\n        <source>Click <g id=\"1\" ctype=\"bold\">Save</g> to keep your changes.</source>…"}],"page_url":"https://aiskills402.com/skills/xliff-translate","markdown_url":"https://aiskills402.com/skills/xliff-translate.md","image_url":"https://cdn.aiskills402.com/og/skills/xliff-translate/7d8ba501.png","related_url":"https://api.aiskills402.com/v1/skills/xliff-translate/related","purchases_count":null,"tested":{"date":"2026-10-09","strong":{"model":"claude-sonnet-5-5 (Claude Code alias \"sonnet\")","verdict":"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\")","verdict":"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.","baseline":{"date":"2026-10-09","rows":[{"label":"XLIFF 1.2 files translated right (23)","better":"higher","strong":{"with":{"n":23,"of":23},"without":{"n":23,"of":23}},"weak":{"with":{"n":23,"of":23},"without":{"n":22,"of":23}}},{"label":"Files refused with a reason (2)","better":"higher","strong":{"with":{"n":2,"of":2},"without":{"n":0,"of":2}},"weak":{"with":{"n":2,"of":2},"without":{"n":0,"of":2}}}],"note":"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."},"report_url":null},"price_usd":"0.01","price_micro":10000,"size_bytes":9262,"sha256":"8c43eb31b755e067dd6657553567e26cf9819f623f6c2059a973c009fe706259","outline":["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"],"license":{"summary":"Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing","holder":"Georgi Kalchev, aiskills402.com","url":"https://aiskills402.com/docs#license"},"buy_url":"https://api.aiskills402.com/v1/skills/xliff-translate/file","redownload_url_template":"https://api.aiskills402.com/v1/purchases/{token}","mcp_tool":null,"payment":{"protocol":"x402","scheme":"exact","asset":"USDC","selling":true,"network":"base","network_caip2":"eip155:8453","pay_to":"0x8e37022edcf0f21cf3c9f93fee9d4d32519f36f4","facilitator":"cdp"},"seo_title":"XLIFF 1.2 Translation That Imports Cleanly","seo_description":"Fill the targets of an XLIFF 1.2 file: sources, ids, states and inline codes kept byte for byte, translate=no respected, XLIFF 2.0 refused. $0.01 once.","versions":[{"version":"1.0.0","date":"2026-10-09","changelog":"# Changelog\n\n## 1.0.0 — 2026-10-09\n\nFirst 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.\n\n## 1.0.1 — 2026-10-09 (finalised after the model test)\n\n- Measured on 25 files (without -> with the skill). 23 to translate: Sonnet 23 -> 23, Haiku 22 -> 23. 2 to refuse: Sonnet 0 -> 2, Haiku 0 -> 2; the shared request does not ask to refuse, so the price rests on the first group.\n- Before the run: five control gaps closed (French mark, per-case forbidden answers for text addressed to the assistant, a source with no letters must come back identical, double-escaped ampersand, the strip in the no-target control). After the run, for both sides: Spanish mark accepts plain words; Fish & chips may stay.\n- Price: $0.01 (no Sonnet gain on translation).\n"}]}