|
| 1 | +<p align="center"> |
| 2 | + <a href="https://simplelocalize.io"> |
| 3 | + <img src="static/simplelocalize-git-banner.png" width="100%"> |
| 4 | + </a> |
| 5 | +</p> |
1 | 6 |
|
| 7 | +<h3 align="center">Translation Management for software projects</h3> |
| 8 | +<p align="center">The easiest way to manage translation files for web and mobile apps.</p> |
| 9 | + |
| 10 | +<p align="center"> |
| 11 | + <a href="https://github.com/simplelocalize/simplelocalize-cli"> |
| 12 | + <img src="static/simplelocalize-git-hero.png"> |
| 13 | + </a> |
| 14 | +</p> |
2 | 15 |
|
3 | 16 |  |
4 | 17 | [](https://codeclimate.com/github/simplelocalize/simplelocalize-cli/maintainability) |
5 | 18 | [](https://codecov.io/gh/simplelocalize/simplelocalize-cli) |
6 | 19 |
|
7 | | -## What it does? |
8 | | - |
9 | | -SimpleLocalize command-line tool allows you to: |
10 | | -- upload and download translations, |
11 | | -- [auto-translate](https://simplelocalize.io/auto-translate) translations, |
12 | | -- publish and push [Translation Hosting](https://simplelocalize.io/translation-hosting) translations, |
13 | | -- extract translation keys from your project files, |
14 | | -- and more... |
15 | | - |
16 | | -It is a great tool for CI/CD pipelines and localization automation. |
| 20 | +SimpleLocalize CLI is a command-line tool that allows you to manage translations in your software project, |
| 21 | +and it's a great tool for CI/CD pipelines and localization automation. |
17 | 22 |
|
18 | | -## Github Actions support |
19 | | - |
20 | | -SimpleLocalize CLI is also availabe as a Github Action here: https://github.com/simplelocalize/github-action-cli |
| 23 | +- **Upload and download translations.** The main purpose of the command-line tool is to upload and download translation files from [Translation Editor](https://simplelocalize.io/translation-editor/) to your project. |
| 24 | +- **[Auto-translate](https://simplelocalize.io/auto-translate) strings.** Start auto-translation jobs from the command-line and get translated strings in a few minutes. |
| 25 | +- **[Hosted translations management](https://simplelocalize.io/translation-hosting).** Push and pull translations from Translation Hosting to your project using the command-line. |
| 26 | +- **[GitHub Actions support](https://github.com/simplelocalize/github-action-cli).** Use SimpleLocalize CLI in your GitHub Actions workflows. |
| 27 | +- **Check project status.** Get project details from the command-line and check if your translations are up-to-date. |
21 | 28 |
|
22 | 29 | ## Installation |
23 | 30 |
|
@@ -92,47 +99,10 @@ Upload format is a format of the file(s) with translations. [See available uploa |
92 | 99 | - `--replace` allows you to **replace** existing translations with new ones. |
93 | 100 | - `--dryRun` allows you to **check** what translation files will be uploaded without actually uploading them. |
94 | 101 | - `--uploadOptions` allows you to pass [additional options](https://simplelocalize.io/docs/general/options/) to the upload command. |
95 | | -Eg.: `--uploadOptions TRIM_LEADING_TRAILING_SPACES`. To pass multiple options, use comma as a separator. |
| 102 | +E.g.: `--uploadOptions TRIM_LEADING_TRAILING_SPACES`. To pass multiple options, use comma as a separator. |
96 | 103 |
|
97 | 104 | Learn more about [upload translations command](https://simplelocalize.io/docs/cli/upload-translations/). |
98 | 105 |
|
99 | | -## Download translations |
100 | | -
|
101 | | -Command downloads translation files from [Translation Editor](https://simplelocalize.io/translation-editor/) to given `<DOWNLOAD_PATH_PATTERN>`, e.g.: `./src/translations/messages.json`. |
102 | | -
|
103 | | -```shell |
104 | | -simplelocalize download |
105 | | - --apiKey <PROJECT_API_KEY> |
106 | | - --downloadPath <DOWNLOAD_PATH_PATTERN> |
107 | | - --downloadFormat <DOWNLOAD_FORMAT> |
108 | | -``` |
109 | | -
|
110 | | -You can use `{lang}` placeholder to specify language or locale and `{ns}` placeholder to specify namespace, |
111 | | -e.g.: `./src/translations/{lang}/{ns}.json`. |
112 | | -
|
113 | | -Download format is a format of the file(s) with translations. [See available download formats](https://simplelocalize.io/docs/general/file-formats/) |
114 | | -
|
115 | | -**Additional parameters:** |
116 | | -- `--downloadOptions` allows you to pass [additional options](https://simplelocalize.io/docs/general/options/) to the download command. Eg.: `--downloadOptions WRITE_NESTED`. |
117 | | -- `--downloadSort` allows you to sort translations in the downloaded file. Eg.: `--downloadSort NEWEST_KEYS_FIRST`. Available options: `NEWEST_KEYS_FIRST`, `NEWEST_KEYS_LAST`, `NAMESPACES`, `IMPORT_ORDER`. |
118 | | -
|
119 | | -Learn more about [download translations command](https://simplelocalize.io/docs/cli/download-translations/). |
120 | | -
|
121 | | -## Auto-translate strings |
122 | | -
|
123 | | -Auto-translate command starts [auto-translation](https://simplelocalize.io/auto-translation) jobs. |
124 | | -
|
125 | | -```properties |
126 | | -simplelocalize auto-translate --apiKey <PROJECT_API_KEY> |
127 | | -``` |
128 | | -
|
129 | | -**Additional parameters:** |
130 | | -- `--languageKeys` allows you to specify languages to auto-translate. Eg.: `--languageKeys en,de,fr`. |
131 | | -
|
132 | | -## Usage examples |
133 | | -
|
134 | | -Below, you can find some examples of using SimpleLocalize CLI. |
135 | | -
|
136 | 106 | ### Example: One file with translations |
137 | 107 |
|
138 | 108 | ```bash |
@@ -194,6 +164,41 @@ simplelocalize upload |
194 | 164 | ``` |
195 | 165 |
|
196 | 166 |
|
| 167 | +## Download translations |
| 168 | +
|
| 169 | +Command downloads translation files from the [Translation Editor](https://simplelocalize.io/translation-editor/) to the given `<DOWNLOAD_PATH_PATTERN>`, |
| 170 | +e.g.: `./src/translations/messages.json`. |
| 171 | +
|
| 172 | +```shell |
| 173 | +simplelocalize download |
| 174 | + --apiKey <PROJECT_API_KEY> |
| 175 | + --downloadPath <DOWNLOAD_PATH_PATTERN> |
| 176 | + --downloadFormat <DOWNLOAD_FORMAT> |
| 177 | +``` |
| 178 | +
|
| 179 | +You can use `{lang}` placeholder to specify language or locale and `{ns}` placeholder to specify namespace, |
| 180 | +e.g.: `./src/translations/{lang}/{ns}.json`. |
| 181 | +
|
| 182 | +Download format is a format of the file(s) with translations. [See available download formats](https://simplelocalize.io/docs/general/file-formats/) |
| 183 | +
|
| 184 | +**Additional parameters:** |
| 185 | +- `--downloadOptions` allows you to pass [additional options](https://simplelocalize.io/docs/general/options/) to the download command. Eg.: `--downloadOptions WRITE_NESTED`. |
| 186 | +- `--downloadSort` allows you to sort translations in the downloaded file. Eg.: `--downloadSort NEWEST_KEYS_FIRST`. Available options: `NEWEST_KEYS_FIRST`, `NEWEST_KEYS_LAST`, `NAMESPACES`, `IMPORT_ORDER`. |
| 187 | +
|
| 188 | +Learn more about [download translations command](https://simplelocalize.io/docs/cli/download-translations/). |
| 189 | +
|
| 190 | +## Auto-translate strings |
| 191 | +
|
| 192 | +Auto-translate command starts [auto-translation](https://simplelocalize.io/auto-translation) jobs for all languages in the project or for languages specified in `--languageKeys` parameter. |
| 193 | +Auto-translation configuration is taken from the last auto-translation job in the project for the given language. |
| 194 | +
|
| 195 | +```properties |
| 196 | +simplelocalize auto-translate --apiKey <PROJECT_API_KEY> |
| 197 | +``` |
| 198 | +
|
| 199 | +**Additional parameters:** |
| 200 | +- `--languageKeys` allows you to specify project language keys to auto-translate, e.g.: `--languageKeys en,de,fr`. |
| 201 | +
|
197 | 202 | ## Translation Hosting: Publish translations |
198 | 203 |
|
199 | 204 | It publishes translation to [Translation Hosting](https://simplelocalize.io/translation-hosting). It behaves exactly the same as publish buttons in the SimpleLocalize (Hosting tab). |
@@ -277,9 +282,8 @@ simplelocalize extract |
277 | 282 | See [available project types](https://simplelocalize.io/docs/cli/i18n-keys-extraction/). |
278 | 283 |
|
279 | 284 |
|
280 | | -
|
281 | 285 | ## Configuration file |
282 | | -Use configuration file in order to simplify your bash command. |
| 286 | +Use configuration file to simplify your bash command. |
283 | 287 | Arguments used in command always override properties set in the configuration file. |
284 | 288 | By default, SimpleLocalize will load configuration from file named `simplelocalize.yml`. |
285 | 289 | You can load configuration from different location by using a `-c` parameters. |
|
0 commit comments