The run command processes translation tasks concurrently by distributing them across a worker pool. Each locale/file combination becomes an independent task, and workers process them simultaneously.
Usage#
bash
# Default concurrency (10 workers)
npx lingo.dev@latest run
# Custom concurrency
npx lingo.dev@latest run --concurrency 20How it works#
- Task creation - the CLI analyzes your
i18n.jsonand creates individual tasks for each locale/file combination - Worker distribution - tasks are assigned to available workers using load balancing
- Concurrent processing - workers translate simultaneously while file-system locks prevent write conflicts
- Result aggregation - completed translations are safely written to target files
Targeting options#
All targeting options from the run command work with parallel processing:
| Option | Description |
|---|---|
--target-locale es | Process specific target languages |
--source-locale en | Override source locale |
--bucket json | Process specific bucket types |
--file components/header | Process specific files (supports glob patterns) |
--key welcome.title | Process specific keys (supports glob patterns) |
--force | Bypass lockfile and retranslate everything |
--frozen | Fail if any content requires translation |
--concurrency 20 | Set number of concurrent workers |
Automatic caching#
When using the Lingo.dev API, large locale files are divided into chunks. Target files are incrementally populated as each chunk returns from the API. If the process is interrupted, the next run resumes from where it left off.
For retranslation, use purge first, then run without --force. This leverages the built-in caching mechanism for more efficient processing compared to run --force.
Safety#
The worker pool prevents file corruption through:
- I/O synchronization - file-system operations are serialized per file
- Lockfile protection - atomic operations prevent concurrent
i18n.lockcorruption - Transactional processing - each task completes fully or fails cleanly
