XLIFF 2.x format (.xlf, .xliff)
XLIFF 2.x is the modern OASIS XML interchange standard for bilingual
content. It replaces the 1.2 element soup with an explicit
<unit>/<segment> structure, file-scoped notes, a small set of inline tag
elements (ph, pc, sc/ec, mrk), and per-segment translation states.
The reader accepts the 2.0, 2.1, and 2.2 namespaces as one compatible family.
The reader emits one block per translatable unit and preserves inline markup as raw inner XML so unmodified content round-trips byte-for-byte. The writer can emit any 2.x version: by default it preserves the input document's version on round-trip and falls back to 2.2 for content extracted from a non-XLIFF source. This mirrors Okapi's XLIFF 2 filter.
How kapi reads it
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
codeFinderRules | array | Regex-mønstre som matcher innebygd kode i oversettbar tekst | |
discardInvalidTargets | boolean | false | Forkast mål som ikke består validering i stedet for å avvise hele filen |
forceUniqueIds | boolean | false | Sørg for at innebygde tagg-ID-er er unike innenfor hver enhet |
ignoreTagTypeMatch | boolean | false | Ignorer typemismatch for tagger mellom kilde- og målsegmenter |
useCodeFinder | boolean | false | Aktiver regex-basert deteksjon av innebygd kode i oversettbar tekst |
version | string | "" | Mål-XLIFF 2.x-versjon som skal genereres. Tom betyr: bevar inndatadokumentets versjon ved rundtur, ellers standard til 2.2. |
writeOriginalData | boolean | true | Utdata inkluderer originaldata når tilgjengelig |
Configure it live
Examples
Force XLIFF 2.0 output
Emit 2.0 regardless of the input document version.
version: "2.0"
Tolerate invalid targets
Drop targets that fail validation rather than rejecting the file.
discardInvalidTargets: true
Processing notes
One block is emitted per translatable unit; inline markup is preserved as raw inner XML for byte-faithful round-trips.
The 2.0, 2.1, and 2.2 namespaces are accepted as a compatible family on read.
← Back to the Format Reference