Gå til hovedinnhold

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.

Commandtm import
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 tm import corpus.tmx -s en -t fr
Flags
FlagTypeDefaultDescription
--all-pairsboolfalseemit entries for every (src,tgt) pair present in each TU (multilingual TMX)
--filestringexplicit path to resource file
--formatstringautoinput format (auto, tmx, klftm); auto selects by file extension
--localboolfalseuse resource in current directory
--localesstringcomma-separated locale subset for --all-pairs (empty = all languages in file)
--namestringnamed resource in KAPI_HOME (e.g. --name project-terms)
--source-locale, -sstringensource locale
--target-locale, -tstringtarget locale
More examples
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