On this page
Other commands
The commands besides sync, download and the workspace commands. Each takes the settings of the project as every command does: your project's settings.
save-missing
Adds the keys of your files that are missing in Locize. It changes no existing key and deletes nothing.
locize save-missing --path ./localesIt takes the file options of sync (--path, --format, --path-mask, --reference-language-path-mask, --language-folder-prefix), and --language, --namespace, --ver, --reference-language-only and --dry. Use it when your keys come from an extraction tool and should only be added; use sync to change or delete keys.
add, remove, get
Add, remove or read a single key.
locize add common button.save "Save" --language en
locize remove common button.save button.cancel
locize get common button.save --language en| Command | What it does |
|---|---|
add <namespace> <key> <value> | adds the key, or changes its text, in --language |
remove <namespace> <key...> | removes one or more keys; without --language in every language |
get <namespace> <key> | prints the key's text in --language |
Each takes --ver, latest by default.
publish-version
Publishes a version to the CDN.
locize publish-version --ver production| Option | What it does | Default |
|---|---|---|
--ver | the version | latest |
--tenants | publishes the project's tenants too | false |
copy-version
Copies the content of one version into another, as Overwrite version does in the app.
locize copy-version latest --ver production| Option | What it does | Default |
|---|---|---|
--ver | the version that is overwritten | latest |
--ignore-if-version-exists | skips the copy when that version already exists | false |
remove-version
Deletes a version.
locize remove-version stagingIt needs an API key with the role admin, or a personal access token with the scope manage of an admin or of a manager without restrictions to versions, languages or namespaces.
delete-namespace
Deletes a namespace in Locize, in every language of the version, and in every tenant of the project with their overrides.
locize delete-namespace common --ver latestformat
Rewrites local files in the form their format expects, for example after you edited them by hand. It shows what changes and needs no project.
locize format ./locales --format json| Option | What it does | Default |
|---|---|---|
--format | the format of the files; it must match their file extension | json |
--reference-language | the source language, which some formats need | en |
--dry | shows the changes, and writes nothing | false |
migrate
Uploads existing JSON files into the project once. sync does the same with every format and keeps your files in step afterwards, so prefer sync.
locize migrate --path ./locales| Option | What it does | Default |
|---|---|---|
--path | the folder with your files | the current folder |
--parse-language | reads each folder as a language | true |
--language | the language, when your folder holds only one language's files | none |
--replace | empties an existing namespace before it writes | false |
--download | downloads all translations afterwards | false |
login, logout
locize login signs you in through the browser, locize logout signs you out and revokes the token: Sign in.