Gå til hovedinnhold

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.

IDxliff2
SourceBuilt-in
Extensions.xlf, .xliff
MIME Typesapplication/xliff+xml
CapabilitiesRead + Write

How kapi reads it

Parameters

ParameterTypeDefaultDescription
codeFinderRulesarrayRegex-mønstre som matcher innebygd kode i oversettbar tekst
discardInvalidTargetsbooleanfalseForkast mål som ikke består validering i stedet for å avvise hele filen
forceUniqueIdsbooleanfalseSørg for at innebygde tagg-ID-er er unike innenfor hver enhet
ignoreTagTypeMatchbooleanfalseIgnorer typemismatch for tagger mellom kilde- og målsegmenter
useCodeFinderbooleanfalseAktiver regex-basert deteksjon av innebygd kode i oversettbar tekst
versionstring""Mål-XLIFF 2.x-versjon som skal genereres. Tom betyr: bevar inndatadokumentets versjon ved rundtur, ellers standard til 2.2.
writeOriginalDatabooleantrueUtdata inkluderer originaldata når tilgjengelig

Configure it live

Configuration
Loading form…

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