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
SimpleLocalize CLI to simplifies the process of translation in web apps, mobile apps, and games. It can:
10
-
- find translation keys in your local files
11
-
- upload existing translation files or translation keys
12
-
- download translation file in ready to use format for already used i18n library like: i18next, Android, iOS, and many others
13
-
9
+
SimpleLocalize CLI offers:
10
+
- finding and extracting translation keys in your project files
11
+
- uploading translation files or translation keys
12
+
- downloading translation files
13
+
- getting translation project status
14
+
- publishing translations to the CDN.
14
15
15
16
## Installation
16
17
17
-
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.
18
+
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.
Use the same command to update SimpleLocalize CLI to the newest available version.
28
+
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
+
28
31
29
-
You can also put the exact CLI version in URL to make sure the CLI won't change overtime, eg.: `https://get.simplelocalize.io/2.0.6/install` or `https://get.simplelocalize.io/2.0.6/install-windows`.
30
32
31
33
## Usage
32
34
33
-
SimpleLocalize CLI offers a serveral commands to invoke, `upload`, `download`, `sync` and `extract`. All of them requrires `--apiKey=KEY` parameter. You can also create a `simplelocalize.yml` file with configuration.
35
+
SimpleLocalize CLI offers a several commands to invoke, All of them requires`--apiKey=KEY` parameter that is unique for each project.
34
36
35
37
```shell
36
38
simplelocalize [command] ...parameters
37
39
```
38
40
41
+
Commands:
42
+
- `status` - gets translation project details
43
+
- `upload` - uploads translation files or translation keys
44
+
- `download` - downloads translation files
45
+
- `sync` - uploads translation files and downloads translation files
46
+
- `pull` - downloads translation files from [Translation Hosting](https://simplelocalize.io/translation-hosting)
47
+
- `publish` - publishes translations to [Translation Hosting](https://simplelocalize.io/translation-hosting)
48
+
- `extract` - finds and extracts translation keys in your project files
49
+
39
50
### Upload translations
40
51
41
52
Command uploads translation files from given `<UPLOAD_PATH>` to SimpleLocalize.
@@ -85,7 +96,7 @@ simplelocalize sync
85
96
86
97
`--downloadOptions` and `--uploadOptions` parameters are optional.
87
98
88
-
## Extract translation keys
99
+
### Extract translation keys
89
100
90
101
Extract command finds and upload translation keys from project source code at `<SEARCH_DIRECTORY>` to SimpleLocalize.
91
102
@@ -99,51 +110,9 @@ simplelocalize extract
99
110
See [available project types](https://simplelocalize.io/docs/cli/i18n-keys-extraction/).
100
111
101
112
102
-
## Configuration file
103
-
Use configuration file in order to simplify your bash command. Arguments used in command always overrides properties set in 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.
104
-
105
-
```properties
106
-
# Load default simplelocalize.yml file
107
-
simplelocalize upload
108
-
109
-
# Use configuration file at custom location
110
-
simplelocalize -c my-configuration.yml upload
111
-
```
112
-
113
-
### Sample configuration file
114
-
115
-
Filename: `simplelocalize.yml`
116
-
117
-
```yaml
118
-
# Get started with CLI: https://simplelocalize.io/docs/cli/get-started/
119
-
# Available formats: https://simplelocalize.io/docs/general/file-formats/
120
-
# Available import/export options: https://simplelocalize.io/docs/general/options/
# by default, the 'upload' command only adds new keys and fills empty translations,
131
-
# add this option to overwrite existing translations with values from the uploaded file
132
-
- REPLACE_TRANSLATION_IF_FOUND
133
-
134
-
# Properties used by 'download' command
135
-
downloadPath: ./src/{ns}/messages_{lang}.json
136
-
downloadFormat: single-language-json
137
-
downloadOptions:
138
-
- WRITE_NESTED
139
-
140
-
# Properties used by 'extract' command
141
-
searchDir: ./src
142
-
projectType: yahoo/react-intl
143
-
ignoreKeys:
144
-
- 'WELCOME'
145
-
- 'ABOUT-US'
146
-
```
115
+
Below you can find some examples of using SimpleLocalize CLI.
147
116
148
117
### Example: One file with translations
149
118
@@ -153,7 +122,7 @@ ignoreKeys:
153
122
└── messages.json
154
123
```
155
124
156
-
CLI command:
125
+
Command:
157
126
```
158
127
simplelocalize upload
159
128
--apiKey <PROJECT_API_KEY>
@@ -162,7 +131,7 @@ simplelocalize upload
162
131
```
163
132
164
133
165
-
### Example: Single file with multiple language directories
134
+
### Example: Single file in multiple language directories
166
135
167
136
```bash
168
137
.
@@ -174,15 +143,15 @@ simplelocalize upload
174
143
└── index.json
175
144
```
176
145
177
-
CLI command:
146
+
Command:
178
147
```
179
148
simplelocalize upload
180
149
--apiKey <PROJECT_API_KEY>
181
150
--uploadPath /{lang}/index.json
182
151
--uploadFormat single-language-json
183
152
```
184
153
185
-
### Example: Multiple files with multiple language directories
154
+
### Example: Multiple files in multiple language directories
186
155
187
156
```bash
188
157
.
@@ -197,39 +166,102 @@ simplelocalize upload
197
166
└── home.json
198
167
```
199
168
200
-
CLI command:
169
+
Command:
201
170
```
202
171
simplelocalize upload
203
172
--apiKey <PROJECT_API_KEY>
204
173
--uploadPath /{lang}/{ns}.json
205
174
--uploadFormat single-language-json
206
175
```
207
176
208
-
## Commands documentation
177
+
### Pull resources from Translation Hosting
209
178
210
-
Please remember to [get API Key for your SimpleLocalize project](https://simplelocalize.io/docs/cli/get-started/) before your start.
179
+
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`.
211
180
212
-
- `simplelocalize extract` - learn more [how to extract translation keys from local files](https://simplelocalize.io/docs/cli/i18n-keys-extraction/)
213
-
- `simplelocalize upload` - learn more [how to upload translations or translation keys](https://simplelocalize.io/docs/cli/upload-translations/)
214
-
- `simplelocalize download` - learn more [how to download ready to use translation file](https://simplelocalize.io/docs/cli/download-translations/)
It publishes translation to Translation Hosting. It behaves exactly the same as publish buttons in the SimpleLocalize (Hosting tab).
225
191
226
-
## Documentation
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`).
194
+
195
+
```
196
+
simplelocalize publish
197
+
--apiKey <PROJECT_API_KEY>
198
+
--environment latest
199
+
```
227
200
228
-
Head to [simplelocalize.io/docs](https://simplelocalize.io/docs/cli/get-started/) to learn the SimpleLocalize basics
201
+
### Getting project details
229
202
230
-
## How to build project, contribute or add features?
203
+
Command gets project details and prints them to the console.
204
+
205
+
```
206
+
simplelocalize publish
207
+
--apiKey <PROJECT_API_KEY>
208
+
```
209
+
210
+
211
+
## 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.
213
+
214
+
```properties
215
+
# Load default simplelocalize.yml file
216
+
simplelocalize upload
217
+
218
+
# Use configuration file at custom location
219
+
simplelocalize -c my-configuration.yml upload
220
+
```
221
+
222
+
### Sample configuration file
223
+
224
+
Filename: `simplelocalize.yml`
225
+
226
+
```yaml
227
+
# Get started with CLI: https://simplelocalize.io/docs/cli/get-started/
228
+
# Available formats: https://simplelocalize.io/docs/general/file-formats/
229
+
# Available import/export options: https://simplelocalize.io/docs/general/options/
0 commit comments