Skip to content
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.

bash
locize save-missing --path ./locales

It 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.

bash
locize add common button.save "Save" --language en
locize remove common button.save button.cancel
locize get common button.save --language en
CommandWhat 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.

bash
locize publish-version --ver production
OptionWhat it doesDefault
--verthe versionlatest
--tenantspublishes the project's tenants toofalse

copy-version

Copies the content of one version into another, as Overwrite version does in the app.

bash
locize copy-version latest --ver production
OptionWhat it doesDefault
--verthe version that is overwrittenlatest
--ignore-if-version-existsskips the copy when that version already existsfalse

remove-version

Deletes a version.

bash
locize remove-version staging

It 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.

bash
locize delete-namespace common --ver latest

format

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.

bash
locize format ./locales --format json
OptionWhat it doesDefault
--formatthe format of the files; it must match their file extensionjson
--reference-languagethe source language, which some formats needen
--dryshows the changes, and writes nothingfalse

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.

bash
locize migrate --path ./locales
OptionWhat it doesDefault
--paththe folder with your filesthe current folder
--parse-languagereads each folder as a languagetrue
--languagethe language, when your folder holds only one language's filesnone
--replaceempties an existing namespace before it writesfalse
--downloaddownloads all translations afterwardsfalse

login, logout

locize login signs you in through the browser, locize logout signs you out and revokes the token: Sign in.