Gå til hovedinnhold

kapi extract

kapi extract

Emit bilingual XLIFF 2.x (default) or PO files for each target locale declared in a .kapi project, pre-filled from the project's translation memory.

Each invocation writes one batch of outputs under .kapi/cache/extractions/<batch-id>/ plus one bilingual file per source → target pair in --out-dir (default "out/").

Commandextract
Groupcontent
Try it

Runs in your browser against a small sample file. Edit the command before running, or press Run to execute it as shown.

kapi extract -p app.kapi --no-tm
Flags
FlagTypeDefaultDescription
--formatstringxliff2bilingual output format (xliff2 | po | klz)
--no-tmboolfalseskip TM pre-fill on extract
--onlystringrestrict to a single content collection by name
--outstringmerge-time output layout recorded in the .klz (e.g. 'l10n/{lang}/{name}.{ext}')
--out-dirstringoutdirectory for emitted bilingual files (relative to project)
--output, -ostringwrite an ad-hoc .klz workspace from the given source files
--patternstringextra glob pattern restricting which source files to include
--project, -pstringpath to a .kapi project recipe (auto-discovered from cwd if omitted)
--redactboolfalsereplace sensitive content with placeholders; originals stay in a local vault for merge
--redact-rulesstringpath to a redaction rules YAML file (implies --redact)
--target-langstringcomma-separated target locales (default: all in recipe)
--with-sourceboolfalseembed raw source bytes in the .klz (default: identity + skeleton only)
--xliff-versionstringXLIFF 2.x version to emit (2.0, 2.1, 2.2; default 2.2)
More examples
kapi extract -p app.kapi --target-lang fr
kapi extract -p app.kapi --target-lang fr,de,es
kapi extract src/*.json -o work.klz --target-lang fr,qps # ad-hoc .klz workspace

← Back to the Command Reference