Skip to content

Commit b0148b8

Browse files
authored
Update README.md
1 parent af1b2ff commit b0148b8

File tree

1 file changed

+13
-178
lines changed

1 file changed

+13
-178
lines changed

README.md

Lines changed: 13 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -81,162 +81,36 @@ e.g.: `./src/translations/{lang}/{ns}.json`.
8181
8282
```shell
8383
simplelocalize upload
84-
--apiKey <PROJECT_API_KEY>
85-
--uploadPath <UPLOAD_PATH_PATTERN>
86-
--uploadFormat <UPLOAD_FORMAT>
87-
```
88-
89-
Upload format is a format of the file(s) with translations. [See available upload formats](https://simplelocalize.io/docs/general/file-formats/)
90-
91-
**Additional parameters:**
92-
- `--replace` allows you to **replace** existing translations with new ones,
93-
- `--dryRun` allows you to **check** what translation files will be uploaded without actually uploading them,
94-
- `--namespace` download translations for a specific namespace, e.g.: `--namespace home`,
95-
- `--customerId` download translations for a specific customer, e.g.: `--customerId ikea`,
96-
- `--uploadOptions` allows you to pass [additional options](https://simplelocalize.io/docs/general/options/) to the upload command, E.g.: `--options TRIM_LEADING_TRAILING_SPACES`. To pass multiple options, use comma as a separator.
97-
98-
> Since version 2.7 you can skip 'upload' part in the parameters names, e.g.: `--path` instead of `--uploadPath`.
99-
100-
Learn more about [upload translations command](https://simplelocalize.io/docs/cli/upload-translations/).
101-
102-
### Example: One file with multiple languages
103-
104-
```bash
105-
.
106-
└── locales
107-
   └── messages.json
108-
```
109-
110-
Command:
111-
```
112-
simplelocalize upload
113-
--apiKey <PROJECT_API_KEY>
114-
--uploadPath ./locales/messages.json
115-
--uploadFormat multi-language-json
116-
```
117-
118-
### Example: One file per language
119-
120-
In this example we upload only source translations from `./en/messages.json` and uses `--uploadLanguageKey en-GB` to specify language key for the uploaded file for the Translation Editor.
121-
It's a recommended way to upload source translations.
122-
123-
```bash
124-
.
125-
├── ca
126-
│   └── messages.json
127-
├── en
128-
│   └── messages.json
129-
└── es
130-
└── messages.json
131-
```
132-
133-
Command:
134-
```
135-
simplelocalize upload
136-
--apiKey <PROJECT_API_KEY>
137-
--uploadPath ./en/index.json
138-
--uploadLanguageKey en-GB
139-
--uploadFormat single-language-json
140-
```
141-
142-
### Example: One file per language using placeholders
143-
144-
In this example we use `{lang}` placeholder to upload **many files** at once and specify language key for each file.
145-
It's not a recommended way to upload source translations, as it uploads more files than necessary.
146-
147-
```bash
148-
.
149-
├── ca
150-
│   └── index.json
151-
├── en
152-
│   └── index.json
153-
└── es
154-
└── index.json
155-
```
156-
157-
Command:
158-
```
159-
simplelocalize upload
160-
--apiKey <PROJECT_API_KEY>
161-
--uploadPath /{lang}/index.json
162-
--uploadFormat single-language-json
163-
```
164-
165-
### Example: One file per language and namespace
166-
167-
In this example we use `{ns}` placeholder to upload **many files** at once for the English language. We used `--uploadLanguageKey en-GB` to specify language key for the uploaded file for the Translation Editor.
168-
169-
```bash
170-
.
171-
├── italian
172-
│   ├── common.json
173-
│   └── home.json
174-
├── english
175-
│   ├── common.json
176-
│   └── home.json
177-
└── spanish
178-
├── common.json
179-
└── home.json
180-
```
181-
182-
Command:
183-
```
184-
simplelocalize upload
185-
--apiKey <PROJECT_API_KEY>
186-
--uploadPath /english/{ns}.json
187-
--uploadLanguageKey en-GB
188-
--uploadFormat single-language-json
84+
--apiKey PROJECT_API_KEY
85+
--uploadPath INPUT_FILE
86+
--uploadFormat FILE_FORMAT
18987
```
19088
89+
[GitHub Wiki: Upload translations](/simplelocalize/simplelocalize-cli/wiki/Upload-translations)
19190
19291
## Download translations
19392
19493
Download works similarly to the upload command, but this time it exports translation files from the Translation Editor to your local files.
19594
19695
```shell
19796
simplelocalize download
198-
--apiKey <PROJECT_API_KEY>
199-
--downloadPath <DOWNLOAD_PATH_PATTERN>
200-
--downloadFormat <DOWNLOAD_FORMAT>
97+
--apiKey PROJECT_API_KEY
98+
--downloadPath OUTPUT_FILE
99+
--downloadFormat FILE_FORMAT
201100
```
202101
203-
Download format is a format of the file(s) with translations. [See available upload formats](https://simplelocalize.io/docs/general/file-formats/)
204-
205-
### Example
206-
207-
Same as before you can use `{lang}` and `{ns}` placeholders to download many files at once and specify language keys that should be downloaded, eg.:
208-
209-
```shell
210-
simplelocalize download
211-
--apiKey <PROJECT_API_KEY>
212-
--downloadPath ./src/{ns}/messages_{lang}.json
213-
--downloadFormat single-language-json
214-
--downloadLanguageKey en,de,fr
215-
```
216-
217-
**Additional parameters:**
218-
- `--downloadLanguageKey` allows you to download translation for specified languages. E.g.: `--languageKey en,de,fr`.
219-
- `--downloadCustomerId` allows you to download translations for a specific customer. E.g.: `--customerId ikea`.
220-
- `--downloadNamespace` allows you to download translations for a specific namespace. E.g.: `--namespace home`.
221-
- `--downloadOptions` allows you to pass [additional options](https://simplelocalize.io/docs/general/options/) to the download command. E.g.: `--options WRITE_NESTED`.
222-
- `--downloadSort` allows you to sort translations in the downloaded file. E.g.: `--sort NEWEST_KEYS_FIRST`. Available options: `NEWEST_KEYS_FIRST`, `NEWEST_KEYS_LAST`, `NAMESPACES`, `IMPORT_ORDER`.
223-
224-
> Since version 2.7 you can skip 'download' part in the parameters names, e.g.: `--path` instead of `--downloadPath`.
225-
226-
Learn more about [download translations command](https://simplelocalize.io/docs/cli/download-translations/).
102+
[GitHub Wiki: Download translations](/simplelocalize/simplelocalize-cli/wiki/Download-translations)
227103
228104
## Auto-translate strings
229105
230-
Auto-translate command starts auto-translation tasks for all languages in the project or for languages specified in `--languageKeys` parameter.
231-
Auto-translation configuration is taken from the last auto-translation job in the project for the given language.
106+
Auto-translate command starts auto-translation tasks for all languages in the project or for languages specified in `--languageKeys` parameter.
232107
233108
```properties
234-
simplelocalize auto-translate --apiKey <PROJECT_API_KEY>
109+
simplelocalize auto-translate
110+
--apiKey PROJECT_API_KEY
111+
--languageKeys en,fr,de,pl
235112
```
236113
237-
**Additional parameters:**
238-
- `--languageKeys` allows you to specify project language keys to auto-translate, e.g.: `--languageKeys en,de,fr`.
239-
240114
## Translation Hosting: Publish translations
241115
242116
It publishes translation to [Translation Hosting](https://simplelocalize.io/translation-hosting). It behaves exactly the same as publish buttons in the SimpleLocalize (Hosting tab).
@@ -315,46 +189,7 @@ simplelocalize upload
315189
simplelocalize -c my-configuration.yml upload
316190
```
317191
318-
## Sample configuration file
319-
320-
Filename: `simplelocalize.yml`
321-
322-
```yaml
323-
# Get started with CLI: https://simplelocalize.io/docs/cli/get-started/
324-
# Available formats: https://simplelocalize.io/docs/general/file-formats/
325-
# Available import/export options: https://simplelocalize.io/docs/general/options/
326-
327-
328-
# Project API Key
329-
apiKey: API_KEY
330-
331-
# Properties used by 'upload' command
332-
uploadPath: ./source-translations/messages_en.json
333-
uploadLanguageKey: en-GB
334-
uploadFormat: single-language-json
335-
uploadOptions:
336-
# by default, the 'upload' command only adds new keys and fills empty translations,
337-
# add this option to overwrite existing translations with values from the uploaded file
338-
- REPLACE_TRANSLATION_IF_FOUND
339-
340-
# Properties used by 'download' command
341-
downloadPath: ./output-translations/messages_{lang}.json
342-
downloadLanguageKeys: ['de-DE', 'fr-FR', 'pl-PL']
343-
downloadFormat: single-language-json
344-
downloadOptions:
345-
- WRITE_NESTED
346-
347-
# Properties used by 'extract' command
348-
searchDir: ./src
349-
projectType: yahoo/react-intl
350-
ignoreKeys:
351-
- 'WELCOME'
352-
- 'ABOUT-US'
353-
354-
# Properties used by 'pull' and 'publish' command
355-
pullPath: ./src/hosting/
356-
environment: '_production' # or '_latest', or 'my_custom'
357-
```
192+
[GitHub Wiki: Configuration file](/simplelocalize/simplelocalize-cli/wiki/Configuration-file)
358193
359194
## Proxy support
360195

0 commit comments

Comments
 (0)