CLI Commands
download
Download translation files from Multilocale to your local project.
multilocale download [options]
Options
| Flag | Description |
|---|---|
--project [project] | Project ID or name |
--format [format] | Output format: json, esm, js, cjs |
--extension [extension] | File extension for dictionary files |
--header [header] | Header text prepended to each file |
--post-script [post-script] | Shell command to run after download |
Examples
# Download as JSON files
multilocale download --project my-app --format json
# Download as ES modules
multilocale download --project my-app --format esm --extension .js
The CLI uses your project's paths configuration to determine where files are written. Paths use the %lang% placeholder for the language code, e.g., translations/%lang%.json.
For Android projects, the CLI automatically detects res/values/strings.xml and writes to the standard Android resource directory structure.
import
Import local translation files into Multilocale.
multilocale import [options]
Options
| Flag | Description |
|---|---|
--project [project] | Project ID or name |
Examples
multilocale import --project my-app
The CLI detects whether your project is an Android or JavaScript project:
- Android: Reads
strings.xmlfiles fromres/values*/directories - JavaScript: Reads JSON files based on the project's
pathsconfiguration
Missing translations for any language are auto-translated using the default locale as the source.
add
Add a new phrase and auto-translate it to all project locales.
multilocale add <key> [value] [options]
Arguments
| Argument | Description |
|---|---|
key | The translation key |
value | The value in the default language. If omitted, uses the key as the value. |
Options
| Flag | Description |
|---|---|
--project [project] | Project ID or name |
Examples
# Add with explicit value
multilocale add welcome_message "Welcome to our app" --project my-app
# Add using key as value
multilocale add "Welcome to our app" --project my-app
The phrase is created in the project's default locale, then auto-translated to all other locales.
localize
Add one or more locales to a project and translate all existing phrases into them.
multilocale localize <locales> [options]
Arguments
| Argument | Description |
|---|---|
locales | Comma-separated locale codes, or all to add all supported languages |
Options
| Flag | Description |
|---|---|
--project [project] | Project ID or name |
Examples
# Add Spanish and French
multilocale localize es,fr --project my-app
# Add all supported languages
multilocale localize all --project my-app
Locales that already exist in the project are skipped. For JavaScript projects, the CLI reads existing translation files and translates them to the new locales.
unused
Find translation keys that are not referenced in any source file.
multilocale unused [options]
Options
| Flag | Description |
|---|---|
--project [project] | Project ID or name |
Examples
multilocale unused --project my-app
The CLI scans all .js, .jsx, .ts, .tsx, .cjs, and .mjs files in your project for references to each translation key. Keys that are not found in any source file are reported.
duplicates
Find phrase keys that have duplicate values in the default language.
multilocale duplicates [options]
Options
| Flag | Description |
|---|---|
--project [project] | Project ID or name |
Examples
multilocale duplicates --project my-app
This helps identify phrases that could be consolidated. For each duplicate value, the command lists all keys sharing that value and notes if any are shared with other projects.
login
Authenticate with your Multilocale account.
multilocale login
You'll be prompted for your email and password.
logout
End your current session.
multilocale logout