kapi tm import
kapi import [file]Import a single TMX file (plain or .gz) or a native .klftm file into the TM.
klftm is the KLF-family native TM form: a deterministic, lossless JSON serialization that round-trips every TMEntry field (entity mappings, provenance origins, properties, notes) that TMX drops. Importing a .klftm preserves entry identity verbatim, so re-seeding a TM from committed .klftm files is fully reproducible. The format is selected by file extension; --format overrides.
By default, imports entries matching the given --source-locale and --target-locale. Use --all-pairs to emit entries for every (src, tgt) language pair present in each TU — useful for multilingual TMX files (e.g. EUR-Lex Euramis exports where a single TU may contain 24+ languages). Combine with --locales to restrict the pair set (e.g. --all-pairs --locales en-GB,fr-FR,de-DE).
The importer auto-detects UTF-8/UTF-16 from the BOM, so Euramis exports work without pre-conversion. For web-crawl TMX sets (bitextor output) the per-TUV <prop type="source-document"> URL is recorded as Origin.Reference.
Runs in your browser against a small sample file. Edit the command before running, or press Run to execute it as shown.
kapi tm import corpus.tmx -s en -t fr| Flag | Type | Default | Description |
|---|---|---|---|
| --all-pairs | bool | false | emit entries for every (src,tgt) pair present in each TU (multilingual TMX) |
| --file | string | explicit path to resource file | |
| --format | string | auto | input format (auto, tmx, klftm); auto selects by file extension |
| --local | bool | false | use resource in current directory |
| --locales | string | comma-separated locale subset for --all-pairs (empty = all languages in file) | |
| --name | string | named resource in KAPI_HOME (e.g. --name project-terms) | |
| --source-locale, -s | string | en | source locale |
| --target-locale, -t | string | target locale |
kapi tm import corpus.tmx --all-pairs --locales en,fr,de --name my-tm kapi tm import seeds/builtins-nb.klftm← Back to the Command Reference