eloqnt/cli
eloqnt crowdin
Sync messages with an existing Crowdin project.
When localization is outgrowing your repo, a translation management system like Crowdin adds helpful features that enable non-developers to participate in the workflow:
- Integration with 3rd-party services (Figma, CMS, …)
- Collaboration with team members
- Reviews of translations
- Project-wide glossaries
- Screenshots
- … and more
Note that if you offload the translation step to Crowdin, you can still benefit from eloqnt lint and eloqnt review before translation work begins.
crowdin.yml
The sync is driven by a crowdin.yml file at your project root.
To authenticate the CLI, create a personal access token in your Crowdin account settings, make it available as CROWDIN_PERSONAL_TOKEN in your environment.
Then, map your messages to the Crowdin project:
crowdin.yml
project_id: '123456'files:- source: /messages/en.jsontranslation: /messages/%two_letters_code%.json
The file follows the Crowdin configuration and supports a subset of its options.
The supported options are:
- Top-level:
project_id,api_token,base_path, andbase_url(each inline, via its_envvariant, or via the ambientCROWDIN_*environment variables), pluspreserve_hierarchy. - Per files entry:
source,translation,type,ignore,update_option, andskip_untranslated_strings.
Unsupported options will either warn or error based on the severity.
Upload sources
After adding or changing source strings, push your source files to the Crowdin project.
Files are created on the first upload and updated in place afterwards:
Flags
| --branch | string | Sync with this branch of the Crowdin project (created when missing) |
| --config | string | Path to the eloqnt config file (defaults to .eloqnt/config.{ts,mts,js,mjs}) |
| --json | boolean | Output the result as JSON |
Upload translations
Seed the project with translations that already exist locally.
They arrive unapproved, so reviewers in Crowdin stay in charge:
Flags
| --branch | string | Sync with this branch of the Crowdin project |
| --locale | string | Restrict to these target languages (comma-separated) |
| --config | string | Path to the eloqnt config file (defaults to .eloqnt/config.{ts,mts,js,mjs}) |
| --json | boolean | Output the result as JSON |
Download translations
Once translations are ready in Crowdin, pull them into your repo.
Downloading overwrites local translation files with Crowdin's version:
Flags
| --branch | string | Sync with this branch of the Crowdin project |
| --locale | string | Restrict to these target languages (comma-separated) |
| --config | string | Path to the eloqnt config file (defaults to .eloqnt/config.{ts,mts,js,mjs}) |
| --json | boolean | Output the result as JSON |