Gå til hovedinnhold

Estimate a translation job

Runs anywhere

No project needed — kapi word-count runs ad-hoc on any file, directory, or glob.

Goal: put a number on a translation job before you commission it. kapi word-count reads any supported format and reports the translatable units and their word total — the figure you paste into a quote.

Steps

  1. Point kapi word-count at a file (or a directory, or a glob).
  2. Read off the block and source-word totals.
  3. Multiply by your vendor's per-word rate to size the job.

Word count operates on the extracted content, not the raw bytes: kapi parses the file into translatable blocks first, so boilerplate, keys, and markup are excluded from the total.

Try it

Drop a file (or pick the JSON or Word sample) and kapi counts it in your browser — blocks, source words, and an estimated character total, straight off the extracted content.

Loading the interactive lab…

From the CLI

For scripting and CI, the same count is one command — point it at a file, a directory, or a glob; --json makes it machine-readable:

kapi word-count messages.json
kapi word-count ./locales --json

Loading the walkthrough…

For multi-file projects, point at a directory or a glob; the totals roll up into one figure, with -j to process files in parallel.

The interactive embed and the recorded video both come from walkthroughs/kapi-word-count.scene.yaml. Change the scene spec and regenerate; don't edit the generated output by hand.

In a project

In a .kapi project, run kapi word-count with no arguments to count the recipe's declared content in one figure — kapi resolves the content globs for you, so there's no path or glob to type. See Create your first project.

Next