CLI referenceverbatra translate

verbatra translate

Translate every target locale once, then exit.

Run one translation pass over every target locale, then exit. translate reads the source locale, diffs it against the lock file, sends only the new or changed strings to the provider, runs the integrity checks, writes the locale files, and updates the lock. Anything still current is never re-sent, so you never pay twice for an unchanged string.

Synopsis

verbatra translate [flags]

Flags

FlagArgumentDefaultEffect
--cwd<path>current directoryresolve config and locale files from this directory
--config<path>search for oneload this config file instead of searching for one
--dry-runnoneoffpreview changes without calling a provider or writing files
--prunenonethe config's prune option, otherwise offremove orphaned keys (in a target file but absent from source) from the written file and the lock
--concurrency<n>1translate up to n target locales at once; must be a positive integer
--no-cachenoneoff (cache on)bypass the local translation-memory cache (verbatra.cache.json) for this run
--jsonnoneoffprint the run summary as one JSON object on stdout (the RunSummary shape); errors still go to stderr

By default a run deletes nothing: orphaned keys are reported and left in place. --prune removes exactly those keys and nothing else, and overrides the config's prune option for this run. Before it runs, translate loads .env.local and then .env from the working directory; a variable already set in the real environment wins.

--concurrency runs several target locales in parallel to finish a large project faster. It is refused with exit 2 when the config sets a maxTokens budget, because concurrent locales cannot honor a token cap deterministically (a dry run is exempt). As a run advances, progress is printed to stderr (one line per locale start, provider sub-batch, and locale finish), so a --json run's stdout stays a single clean summary. --no-cache skips the translation-memory cache for the run, making exactly the provider calls it would with no cache present.

Examples

# translate once using the config it finds
verbatra translate

# preview the keys that would be pruned, spending nothing
verbatra translate --prune --dry-run

Exit codes

CodeMeaning
0every target locale succeeded
1the run finished but one or more locales failed
2could not run: a whole-run error (config, source, format, provider, or lock), or a usage error

One locale failing is not fatal: the run finishes, exits 1, and the per-locale detail sits in the summary.

Edit on GitHub