XLIFF
Update supported XLIFF targets while retaining source text and translation-unit identity.
XLIFF carries source text, target text, and the identities that connect them. The xliff file handler translates <source> content into <target> values in XLIFF 1.2 and 2.x documents. It supports plain text and inline codes while retaining source text and unit identifiers for import into your translation system.
Supported unit structures #
This XLIFF 1.2 unit has a plain-text source:
<xliff version="1.2">
<file source-language="en" datatype="plaintext" original="checkout">
<body>
<trans-unit id="delivery">
<source>Choose delivery</source>
</trans-unit>
</body>
</file>
</xliff>For XLIFF 1.2, the handler reads trans-unit entries, including entries inside nested groups. For 2.x, it reads each unit and its segment entries. A unit with several segments produces separate translation work for each segment.
Paired inline codes such as <g> and <pc> retain their structure while their text is translated. Standalone codes such as <ph> remain protected. Keep unit and inline-code identifiers stable and unique: repeated unit IDs depend on occurrence order, and multiple segments within a unit are matched by position. translate="no" on a file, group, or unit excludes everything inside it from translation. In XLIFF 2.x, a unit inside an excluded file or group can set translate="yes" to opt back in. Text inside <mrk translate="no"> stays exactly as written, and a translation that changes it is rejected.
Targets and language metadata #
The current source defines the document. Unchanged units can retain existing nonempty target content when their source and inline codes still correspond. Missing or empty targets need translation. The handler creates <target> elements for translated units that do not already have one.
XLIFF 1.2 output stamps each file's target-language; 2.x output stamps the root's trgLang. XML serialization can normalize layout. A replaced <target> is written as a fresh element, so check its importer-specific attributes and review state alongside the wording.
Configure and import the result #
The CLI infers xliff from .xlf and .xliff. Select files through CLI configuration or GitHub.
Validate the result with the intended importer. Compare source text, target language metadata, inline codes, and segment coverage. Inspect repeated identities and any units deliberately excluded from translation, then review the imported target text.