Skip to content

Commit 2b3b3d7

Browse files
committed
📝 Update README
1 parent cc47b73 commit 2b3b3d7

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

README.md

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,26 @@
33

44
# ✍️Deepl translate cli
55

6-
![sampleMovie](https://i.gyazo.com/907bae0779d11c324576ee7777768312.gif)
6+
![sampleMovie](https://i.gyazo.com/09a4801d44e85980f83666dceda0166e.gif)
7+
78

89
## Installation
910

11+
### By [github release page](https://github.com/Omochice/deepl-translate-cli/releases)
12+
1013
1. Download zipped file from [Releases](https://github.com/Omochice/deepl-translate-cli/releases).
1114

1215
2. Unzip downloaded file.
1316

1417
3. Move executable file into directory in PATH. (like `$HOME/.local/bin/`)
1518

19+
### By `go install`
20+
```sh
21+
go install github.com/Omochice/deepl-translate-cli@latest
22+
```
1623

17-
## Installation
24+
## Usage
1825

19-
### By [github release page](https://github.com/Omochice/deepl-translate-cli/releases)
2026
1. Get deepl access token. See [here](https://www.deepl.com/docs-api).
2127

2228
2. Set access token as `DEEPL_TOKEN`
@@ -27,31 +33,35 @@
2733
export DEEPL_TOKEN <YOUR TOKEN>
2834
```
2935

30-
3. Make configure file in `<user home directory>/.config/deepl-translate-cli/setting.json`.
31-
32-
If run command without existing setting file, auto make it.
36+
3. On the first run, if `<user home directory>/.config/deepl-translate-cli/setting.json` does not exist, make it automatically.
3337

38+
The format of setting file is below.
39+
```json
40+
{
41+
"source_lang": "FILLIN",
42+
"target_lang": "FILLIN"
43+
}
44+
```
3445
For write setting file, see [this page](https://www.deepl.com/docs-api/translating-text/request/).
3546

36-
### By `go install`
37-
```sh
38-
go install github.com/Omochice/deepl-translate-cli@latest
39-
```
4047

41-
## Usage
4248

43-
- If you want translate from existing file.
49+
4. If file path is not specified, load text from STDIN.
50+
51+
Currentry, only one path can be specified as argument.
52+
53+
54+
55+
- If you want to use `source_lang`/`target_lang` without using setting file, try to use `--source_lang (-s)` or `target_lang (-t)` argument.
56+
4457
```console
45-
$ deepl-translate-cli <text.txt>
58+
cat <text.txt> | deepl-translate-cli --source_lang ES --target_lang DE
4659
```
4760

48-
- If you want use stdin.
49-
- with pipe
50-
```console
51-
$ echo "hello" | deepl-translate-cli --stdin
52-
```
53-
- with input
54-
```console
55-
$ deepl-translate-cli --stdin
56-
<input text that wanted translate> <Enter>
57-
```
61+
- If you use Pro plan, use `--pro` flag to switch endpoint URL.
62+
63+
_this feature is not tested because I use free plan._
64+
65+
```console
66+
cat <text.txt> | deepl-translate-cli --pro
67+
```

0 commit comments

Comments
 (0)