XLIFF 1.2 format (.xlf, .xliff)
XLIFF 1.2 is the OASIS XML Localisation Interchange File Format — the
bilingual exchange format that translation tools and TMS platforms use
to move content between extraction and translation. A document groups
<trans-unit> elements under <file> containers, each unit holding a
<source> and an optional <target>, with inline markup represented
through paired (bpt/ept, g) or standalone (x, ph) code
elements and segmentation expressed via <seg-source> and
<mrk mtype="seg">.
The reader emits one block per translatable <trans-unit>, carrying
the source, any existing target, segmentation, alt-trans matches, and
unit metadata. The writer updates targets and, by default, the target
state attribute, so a round-tripped file reflects translation
progress. This mirrors Okapi's XLIFF 1.2 filter.
How kapi reads it
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
addAltTrans | boolean | false | Allow addition of new alt-trans elements |
addTargetLanguage | boolean | true | Add the target-language attribute to file elements if not already present |
allowEmptyTargets | boolean | false | Allow target elements with empty content to be written |
alwaysAddTargets | boolean | false | Add target elements for monolingual XLIFF files that have no target in the source |
codeFinderRules | array | Regex patterns that match inline codes within translatable text | |
editAltTrans | boolean | false | Allow editing of existing alt-trans elements |
fallbackToID | boolean | false | Use the trans-unit id attribute as the block name when no resname attribute is present |
forceUniqueIds | boolean | false | Rewrite trans-unit IDs to enforce uniqueness across the file |
ignoreInputSegmentation | boolean | false | Ignore seg-source/mrk segmentation from the input XLIFF and treat the full source as a single segment |
includeExtensions | boolean | true | Include non-standard namespace extension elements in extracted content |
includeIts | boolean | true | Include ITS (Internationalization Tag Set) markup in extracted content |
overrideTargetLanguage | boolean | false | Override the target-language attribute in the output document with the pipeline target locale |
preserveSpaceByDefault | boolean | false | Treat all content as xml:space="preserve" unless explicitly overridden |
targetStateValue | string | needs-translation | State value to set on target elements when useTranslationTargetState is enabled |
useCodeFinder | boolean | false | Enable regex-based inline code detection in translatable text |
useTranslationTargetState | boolean | true | Update the state attribute on target elements when writing translated XLIFF |
Configure these parameters interactively and copy the YAML on the Format Reference.
Examples
Mark targets as translated
Write a final target state instead of the default needs-translation.
useTranslationTargetState: true targetStateValue: translated
Flatten input segmentation
Treat each source as one segment, ignoring seg-source markers.
ignoreInputSegmentation: true
Processing notes
One block is emitted per translatable
<trans-unit>; units markedtranslate="no"are passed through as non-translatable.Inline markup (
bpt/ept,g,x,ph) and<seg-source>/<mrk mtype="seg">segmentation are read into the block.
← Back to the Format Reference