download
download writes the translations from Locize into a folder. It sends nothing to Locize.
bash
locize download --path ./locales --format jsonWhat it does
It downloads every language and namespace of the version, or the ones you name, and writes one file per language and namespace, for example locales/de/common.json.
With --format android, folders with a region or script carry Android's codes, and the CLI converts them (values-pt-rBR is pt-BR, values-b+sr+Latn is sr-Latn).
Before you run it
- It downloads the published translations. If the version does not publish automatically, publish it first, or add
--unpublished true. - Without an API key it downloads only public versions. A private version needs a key.
Options
Every option takes a value: --skip-empty false, not --skip-empty.
Files
| Option | What it does | Default |
|---|---|---|
--path | the folder the files go into | the current folder |
--format | one of the file formats | json |
--path-mask | the layout of folders and files, without file extension | {{language}}/{{namespace}} |
--reference-language-path-mask | a layout of its own for the files of the source language when their names carry no language code, for example Android's values/{{namespace}} next to values-{{language}}/{{namespace}} | the path mask |
--language-folder-prefix | text before the language in a folder name | none |
--skip-empty | writes no file for an empty namespace | true |
--clean | removes what the path mask wrote into --path before it writes; refused for the working directory or a repository root, unless the path mask starts with a folder | false |
What it covers
| Option | What it does | Default |
|---|---|---|
--ver | the version | latest |
--language, --languages | one language, or several separated by commas | all |
--namespace | one namespace, or several separated by commas | all |
--workspace | a workspace of the project, by its name | none |
--unpublished | downloads the current translations instead of the published ones; needs an API key | false |
--overridden-only | downloads only what a tenant or workspace overrides | false |
Plans:
--unpublishedand--overridden-onlycount as private downloads, and so does every file of a version with private publish. Your plan includes them from Growth on.
Examples
Download the version production as Android files:
bash
locize download --ver production --path ./res --format android \
--path-mask "values-{{language}}/{{namespace}}" \
--reference-language-path-mask "values/{{namespace}}"Download one namespace in German:
bash
locize download --language de --namespace common --path ./locales