Configuration
The Multilocale CLI uses a multilocale.json file in your project root to store project settings.
multilocale.json
{
"projectId": "your-project-id",
"projectName": "your-project-name",
"format": "json",
"extension": ".json",
"header": "",
"postScript": ""
}
Fields
| Field | Type | Description |
|---|---|---|
projectId | string | The Multilocale project ID |
projectName | string | The project name (alternative to projectId) |
format | string | Output format: json, esm, js, cjs |
extension | string | File extension for translation files |
header | string | Text prepended to each generated file |
postScript | string | Shell command to run after the download command |
Project Paths
In the Multilocale dashboard, you can configure paths on your project. These define where translation files are stored in your codebase.
Paths use %lang% as a placeholder for the language code:
translations/%lang%.json
src/locales/%lang%.json
When you run multilocale download, files are written to these paths. When you run multilocale import, files are read from these paths.
Output Formats
| Format | Description | Example Output |
|---|---|---|
json | Standard JSON | { "key": "value" } |
esm | ES module | export default { "key": "value" } |
js | CommonJS | module.exports = { "key": "value" } |
cjs | CommonJS (alias) | module.exports = { "key": "value" } |
Android Projects
For Android projects, the CLI automatically detects the res/ directory structure and reads/writes strings.xml files:
res/values/strings.xml # Default language
res/values-es/strings.xml # Spanish
res/values-fr/strings.xml # French
No paths configuration is needed for Android projects.