Learn advanced command-line parameters that you can use for using Localazy CLI in specific situations such as automated builds and testing.
For the most of the situations, invoking localazy upload
and localazy download
in the correct folder is enough. However, there are numerous parameters that you can use in specific situations.
The general usage pattern for Localazy CLI is:
localazy [command] [options] [groups]
Commands
There are only two commands:
- upload - Run upload rules to collect files and upload them to Localazy servers for processing.
- download - Download files from Localazy servers and run download rules on them.
- list - List files all translated files available on the server.
Options
All these options can be applied to both upload and download commands, some of them may be applied to list command.
For help, invoke localazy [command] -h
.
Option | Description |
---|---|
Override the configuration file name. Default: localazy.json |
|
Override the keys file name. See Authorization. Default: localazy.keys.json |
|
Provide the readkey on the command line. See Authorization. | |
Provide the writeKey on the command line. See Authorization. | |
Do not perform the actual operation, only simulate the process. No files are uploaded nor written. | |
Force the upload operation if the validation step fails. | |
Quiet mode. Print only important information. | |
The app version used for automatic versioning of deprecated phrases. See Upload Reference. Only available for the upload command. | |
Provide additional parameters for transformations and conditions. |
Groups
Groups allow for running only selected rules both for upload and download.
For upload, the group the collected files belongs to is sent to server as an additional information and you can later use it in your download rules to decided what to do with the files.
Let’s consider this sample configuration file:
{
"upload": {
"files": [
{
"pattern": "app/files/en.json"
},
{
"group": "library",
"pattern": "library/files/en.json"
},
{
"group": "web",
"pattern": "web/files/en.json"
}
]
}
}
For the first upload rule with the pattern app/files/en.json
, no group is provided. Missing or empty group is considered default and is always applied.
By invoking Localazy CLI with groups provided, you can easily decide what files to upload:
- Invoking
localazy upload
uploads onlyapp/files/en.json
as the default group is always applied. - Invoking
localazy upload library
uploadsapp/files/en.json
andlibrary/files/en.json
as both the default group and the library group are applied. - Invoking
localazy upload library web
uploads all three files.
Groups are very effective for selecting resources you want to upload / download. They are also great for having the default rule for the source language and kind of all
rule for initial upload of all your existing translations.
Note: You can access the group the collected files belonged to when they were uploaded but groups provided on the command line for download only filter the download rules.