You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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.
15
17
16
18
## Installation
17
19
18
20
The installation process is automated by command-line scripts. Both scripts for Windows (PowerShell) and macOS/Linux/Windows downloads a binary file with CLI, copies it to user files and makes it available to run anywhere in the system from a command-line.
To change or update the CLI version, run the installation script with the desired version number in the URL. You can also put the exact CLI version in URL to
29
-
explicitly point the version you want to use, e.g.: `https://get.simplelocalize.io/2.0.6/install`or `https://get.simplelocalize.io/2.0.6/install-windows`. See [releases](https://github.com/simplelocalize/simplelocalize-cli/releases) for the list of available versions.
30
-
30
+
To change or update the CLI version, run the installation script with the desired version number in the URL, e.g.:
31
+
- `https://get.simplelocalize.io/2.0.6/install`installs version 2.0.6 on macOS/Linux/Windows (WSL)
32
+
- `https://get.simplelocalize.io/2.0.6/install-windows` installs version 2.0.6 on Windows (PowerShell)
31
33
34
+
See [releases](https://github.com/simplelocalize/simplelocalize-cli/releases) for the list of available versions.
32
35
33
36
## Usage
34
37
35
-
SimpleLocalize CLI offers a several commands to invoke, All of them requires `--apiKey=KEY` parameter that is unique for each project.
38
+
The command-line tool offers several commands to execute.
39
+
All of them requires `--apiKey YOUR_API_KEY` parameter that is unique for each project.
36
40
37
41
```shell
38
42
simplelocalize [command] ...parameters
39
43
```
40
44
41
-
Commands:
45
+
Available commands:
46
+
- `init` - creates a sample configuration file
42
47
- `status` - gets translation project details
43
48
- `upload` - uploads translation files or translation keys
44
49
- `download` - downloads translation files
45
50
- `sync` - uploads translation files and downloads translation files
51
+
- `auto-translate` - starts [auto-translation](https://simplelocalize.io/auto-translation) jobs
46
52
- `pull` - downloads translation files from [Translation Hosting](https://simplelocalize.io/translation-hosting)
47
53
- `publish` - publishes translations to [Translation Hosting](https://simplelocalize.io/translation-hosting)
48
54
- `extract` - finds and extracts translation keys in your project files
49
55
50
-
### Upload translations
51
56
52
-
Command uploads translation files from given `<UPLOAD_PATH>` to SimpleLocalize.
57
+
Use `--help` parameter to get more information about the command and its parameters
58
+
or [check documentation](https://simplelocalize.io/docs/cli/get-started/).
59
+
60
+
## Create configuration file
61
+
62
+
Command creates a sample configuration file in the current directory.
63
+
The configuration file simplifies the usage of the command-line tool
64
+
by providing a default configuration for the project and allowing to omit some parameters.
65
+
66
+
```shell
67
+
simplelocalize init
68
+
```
69
+
70
+
## Upload translations
71
+
72
+
Command uploads translation files from given `<UPLOAD_PATH_PATTERN>` to [Translation Editor](https://simplelocalize.io/translation-editor/), e.g.: `./src/translations/messages.json`.
53
73
54
74
```shell
55
75
simplelocalize upload
56
76
--apiKey <PROJECT_API_KEY>
57
-
--uploadPath <UPLOAD_PATH>
77
+
--uploadPath <UPLOAD_PATH_PATTERN>
58
78
--uploadFormat <UPLOAD_FORMAT>
59
-
--uploadOptions <UPLOAD_OPTIONS>
60
79
```
61
80
62
-
`--uploadOptions` parameter is optional. Use `REPLACE_TRANSLATION_IF_FOUND` option to update existing translations.
81
+
You can use `{lang}` placeholder to specify language or locale and `{ns}` placeholder to specify namespace,
82
+
e.g.: `./src/translations/{lang}/{ns}.json`.
83
+
84
+
Upload format is a format of the file(s) with translations. [See available upload formats](https://simplelocalize.io/docs/general/file-formats/)
85
+
86
+
#### Additional parameters:
87
+
- `--replace` allows you to **replace** existing translations with new ones.
88
+
- `--delete` allows you to **delete** translations that are not present in uploaded files.
89
+
- `--dryRun` allows you to **check** what translation files will be uploaded without actually uploading them.
90
+
- `--uploadOptions` allows you to pass [additional options](https://simplelocalize.io/docs/general/options/) to the upload command.
91
+
Eg.: `--uploadOptions TRIM_LEADING_TRAILING_SPACES`. To pass multiple options, use comma as a separator.
63
92
64
93
Learn more about [upload translations command](https://simplelocalize.io/docs/cli/upload-translations/).
65
94
66
-
### Download translations
95
+
## Download translations
67
96
68
-
Command downloads translation files from SimpleLocalize to given `<DOWNLOAD_PATH>`.
97
+
Command downloads translation files from [Translation Editor](https://simplelocalize.io/translation-editor/) to given `<DOWNLOAD_PATH_PATTERN>`, e.g.: `./src/translations/messages.json`.
69
98
70
99
```shell
71
100
simplelocalize download
72
101
--apiKey <PROJECT_API_KEY>
73
-
--downloadPath <DOWNLOAD_PATH>
102
+
--downloadPath <DOWNLOAD_PATH_PATTERN>
74
103
--downloadFormat <DOWNLOAD_FORMAT>
75
-
--downloadOptions <DOWNLOAD_OPTIONS>
76
104
```
77
105
78
-
`--downloadOptions` parameter is optional.
106
+
You can use `{lang}` placeholder to specify language or locale and `{ns}` placeholder to specify namespace,
107
+
e.g.: `./src/translations/{lang}/{ns}.json`.
108
+
109
+
Download format is a format of the file(s) with translations. [See available download formats](https://simplelocalize.io/docs/general/file-formats/)
110
+
111
+
#### Additional parameters:
112
+
- `--downloadOptions` allows you to pass [additional options](https://simplelocalize.io/docs/general/options/) to the download command. Eg.: `--downloadOptions WRITE_NESTED`.
79
113
80
114
Learn more about [download translations command](https://simplelocalize.io/docs/cli/download-translations/).
81
115
82
-
### Sync translations
116
+
## Sync translations
83
117
84
118
Sync command combines upload and download command executions.
85
119
@@ -96,7 +130,19 @@ simplelocalize sync
96
130
97
131
`--downloadOptions` and `--uploadOptions` parameters are optional.
- `--languageKeys` allows you to specify languages to auto-translate. Eg.: `--languageKeys en,de,fr`.
144
+
145
+
## Extract translation keys
100
146
101
147
Extract command finds and upload translation keys from project source code at `<SEARCH_DIRECTORY>` to SimpleLocalize.
102
148
@@ -112,7 +158,7 @@ See [available project types](https://simplelocalize.io/docs/cli/i18n-keys-extra
112
158
113
159
## Usage examples
114
160
115
-
Below you can find some examples of using SimpleLocalize CLI.
161
+
Below, you can find some examples of using SimpleLocalize CLI.
116
162
117
163
### Example: One file with translations
118
164
@@ -174,7 +220,7 @@ simplelocalize upload
174
220
--uploadFormat single-language-json
175
221
```
176
222
177
-
### Pull resources from Translation Hosting
223
+
## Pull resources from Translation Hosting
178
224
179
225
Downloads all translation hosting files to given directory in`--pullPath` parameter. It overwrites existing files and creates subdirectories if necessary. Available environment variables: `latest`, `production`.
180
226
@@ -185,20 +231,27 @@ simplelocalize pull
185
231
--environment latest
186
232
```
187
233
188
-
### Publish resources to Translation Hosting
234
+
Additional parameters:
235
+
`--filterRegex` allows you to filter files by regex, e.g.: `--filterRegex '__index.json'` will download only `__index.json` file.
189
236
190
-
It publishes translation to Translation Hosting. It behaves exactly the same as publish buttons in the SimpleLocalize (Hosting tab).
237
+
## Publish resources to Translation Hosting
191
238
192
-
- `--environment latest` gets translations from Translation Editor and publishes them to Translation Hosting to `latest` environment.
193
-
- `--environment production` gets translations from Translation Hosting (`latest`) and publishes them to Translation Hosting (`production`).
239
+
It publishes translation to [Translation Hosting](https://simplelocalize.io/translation-hosting). It behaves exactly the same as publish buttons in the SimpleLocalize (Hosting tab).
194
240
195
241
```
196
242
simplelocalize publish
197
243
--apiKey <PROJECT_API_KEY>
198
244
--environment latest
199
245
```
200
246
201
-
### Getting project details
247
+
- `--environment latest` gets translations from Translation Editor and publishes them to Translation Hosting to `latest` environment.
248
+
- `--environment production` gets translations from Translation Hosting (`latest`) and publishes them to Translation Hosting (`production`).
Command gets project details and prints them to the console.
204
257
@@ -209,7 +262,10 @@ simplelocalize status
209
262
210
263
211
264
## Configuration file
212
-
Use configuration file in order to simplify your bash command. Arguments used incommand always overrides properties setin configuration file. By default, SimpleLocalize will load configuration from file named `simplelocalize.yml`. You can load configuration from different location by using a `-c` parameters.
265
+
Use configuration file in order to simplify your bash command.
266
+
Arguments used incommand always override properties setin the configuration file.
267
+
By default, SimpleLocalize will load configuration from file named `simplelocalize.yml`.
268
+
You can load configuration from different location by using a `-c` parameters.
0 commit comments