.xlf, .xlif, and .xliff files in XLIFF 1.2 and 2.x shapes.
Prerequisites
You need:- a build or extraction step that produces XLIFF;
- stable IDs for translation units;
- the Hyperlocalise CLI;
- a Cloud project with
en-USas source andfr-FRandde-DEas targets; and HYPERLOCALISE_API_KEYandHYPERLOCALISE_PROJECT_IDin your environment.
1. Produce stable XLIFF units
An XLIFF 1.2 source file can look like:id, name, or resname values. Do not derive IDs from array positions or line numbers.
Keep a <target> element in each source unit. During reconstruction, Hyperlocalise preserves <source> and writes the translated value into <target>.
XLIFF 2.x is supported through
<unit> elements. Keep one translatable segment per unit in the current workflow so one stable unit ID maps to one translation value.2. Map source and targets
Createi18n.yml:
3. Check generated XLIFF in the source pull request
Regenerate the source file and compare it with git:- missing or duplicate unit IDs;
- units without source text;
- invalid XML;
- inline placeholder changes;
- generated IDs that churn after unrelated edits; and
- source units without a target element.
4. Push source XLIFF
After merge:5. Review units and inline placeholders
In Content Editor, verify:<ph>,<g>, or other inline codes remain in the correct semantic position;- placeholders such as
{name}stay unchanged; - notes provide enough product context;
- adjacent units use consistent terminology; and
- target text does not contain escaped placeholder markup.
6. Pull translated XLIFF
Run:source-language, sets target-language, keeps source text, and replaces target text. For XLIFF 2.x it preserves srcLang and sets trgLang.
Inline XML markup remains inline rather than becoming plain escaped text.
7. Validate and import targets
Open a translation pull request, then validate each target against the schema and your importer:xmllint; well-formed XML alone does not prove that the file follows your XLIFF profile.
Test:
- every expected unit imports;
- target locale metadata is correct;
- inline codes survive the import;
- no source-only fallback appears unexpectedly; and
- the importer rejects missing required targets.
XLIFF 2.x example
Use one<segment> per <unit>:
Troubleshooting
Source text changes during pull
Ensure every source unit contains a<target> element. Without one, reconstruction may update the source element because no target node exists.
Units disappear in Cloud
Confirm every<trans-unit> or <unit> has a non-empty stable identifier and source text.

