Skip to content
On this page

download

download writes the translations from Locize into a folder. It sends nothing to Locize.

bash
locize download --path ./locales --format json

What 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

OptionWhat it doesDefault
--paththe folder the files go intothe current folder
--formatone of the file formatsjson
--path-maskthe layout of folders and files, without file extension{{language}}/{{namespace}}
--reference-language-path-maska 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-prefixtext before the language in a folder namenone
--skip-emptywrites no file for an empty namespacetrue
--cleanremoves 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 folderfalse

What it covers

OptionWhat it doesDefault
--verthe versionlatest
--language, --languagesone language, or several separated by commasall
--namespaceone namespace, or several separated by commasall
--workspacea workspace of the project, by its namenone
--unpublisheddownloads the current translations instead of the published ones; needs an API keyfalse
--overridden-onlydownloads only what a tenant or workspace overridesfalse

Plans: --unpublished and --overridden-only count 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