Skip to content

Commit 836f7a2

Browse files
committed
Update README.md
1 parent 8024b13 commit 836f7a2

13 files changed

Lines changed: 47 additions & 24 deletions

README.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22

3-
<img width="630" src="docs/images/logo.png" alt="logo">
3+
<img width="630" src="assets/logo.png" alt="logo">
44

55
A powerful, secure and feature-rich **command line** via Google Translation.
66

@@ -15,7 +15,7 @@ English | [简体中文](README.zh-CN.md)
1515

1616
![Alt](https://repobeats.axiom.co/api/embed/f0b1b8b0150e5f891d765081ad1349cccc127c5c.svg "Repobeats analytics image")
1717

18-
<img width="814" src="docs/images/preview.png" alt="usage-png">
18+
<img width="814" src="assets/preview.png" alt="usage-png">
1919

2020
</div>
2121

@@ -65,6 +65,8 @@ options:
6565
[string] [default: "auto"]
6666
-t, --to The target language (language to be translated to)
6767
specified as language name or ISO 639-1 code
68+
-e, --engine Select translation engine
69+
[string] [choices: "google", "microsoft"] [default: "google"]
6870
[string] [default: "auto"]
6971
--timeout Timeout duration for the translation request in
7072
milliseconds [number] [default: 30000]
@@ -83,6 +85,12 @@ options:
8385
-h, --help Show help info [boolean]
8486
```
8587

88+
### Environment Variables
89+
90+
| Name | Description |
91+
|:--------------------------|:----------------------------------------------------|
92+
| NODE_TRANSLATE_CLI_ENGINE | Specify the translation engine through env variable |
93+
8694
## 🪄 Examples
8795

8896
#### Using stdin
@@ -198,23 +206,31 @@ translate 'Translate this sentence to your clipboard' | clipboard
198206
git commit -m "$(translate 'feat: your commit content' -t zh)"
199207
```
200208

201-
![Alt](docs/images/advanced-usage-accessor.png "Using the static accessor method")
209+
![Alt](assets/advanced-usage-accessor.png "Using the static accessor method")
202210

203211
#### Using the pipe `|` symbol
204212

205213
```shell
206214
npm info npm description | translate -t zh
207215
```
208216

209-
![Alt](docs/images/advanced-usage-pipe.png "Using the pipe | symbol")
217+
![Alt](assets/advanced-usage-pipe.png "Using the pipe | symbol")
210218

211219
#### Using the redirection `>` symbol
212220

213221
```shell
214222
translate "这是一段测试文本。" -t en > usage.txt
215223
```
216224

217-
![Alt](docs/images/advanced-usage-redirection.png "Using the redirection > symbol")
225+
![Alt](assets/advanced-usage-redirection.png "Using the redirection > symbol")
226+
227+
#### Translate `The Rust-lang Book` into your language
228+
229+
```shell
230+
curl https://raw.githubusercontent.com/rust-lang/book/master/src/ch01-00-getting-started.md | translate
231+
```
232+
233+
![Alt](assets/advanced-usage-curl.png "Translate \"The Rust-lang Book\" into your language")
218234

219235
## 🔧 Autocorrect
220236

@@ -224,28 +240,28 @@ translate "这是一段测试文本。" -t en > usage.txt
224240
>
225241
> Detect Language: red background
226242
227-
![Alt](docs/images/autocorrect.png "Color Scheme")
243+
![Alt](assets/autocorrect.png "Color Scheme")
228244

229245
## 🐢 Network anomaly
230246

231247
> When the network is abnormal, the terminal will change as shown in the figure below
232248
> (they actually come from the same line).
233249
234-
![Alt](docs/images/slowly-network.png "Stdout in Terminal")
250+
![Alt](assets/slowly-network.png "Stdout in Terminal")
235251

236252
## ⌨️ Automatic line wrapping
237253

238254
> When a single line of content is too long, the terminal will automatically wrap the line after the title.
239255
240-
![Alt](docs/images/newline.png "Overlong text")
256+
![Alt](assets/newline.png "Overlong text")
241257

242258
## 🌐 i18n
243259

244260
Quickly contribute your language via ease-to-use [node-translate-i18n](https://github.com/kabeep/node-translate-i18n)
245261
in [locale](https://github.com/kabeep/node-translate-cli/tree/master/src/locale/index.ts) file are welcome,
246262
or notify me via [Issues](https://github.com/kabeep/node-translate-cli/issues) for handling.
247263

248-
![Alt](docs/images/i18n.png "Locale from OS")
264+
![Alt](assets/i18n.png "Locale from OS")
249265

250266
## 🔗 Related
251267

README.zh-CN.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div align="center">
22

3-
<img width="630" src="docs/images/logo.png" alt="logo">
3+
<img width="630" src="assets/logo.png" alt="logo">
44

55
一个强大、安全且功能丰富的**命令行**工具,通过 Google 翻译。
66

@@ -15,7 +15,7 @@
1515

1616
![Alt](https://repobeats.axiom.co/api/embed/f0b1b8b0150e5f891d765081ad1349cccc127c5c.svg "Repobeats analytics image")
1717

18-
<img width="814" src="docs/images/preview.png" alt="usage-png">
18+
<img width="814" src="assets/preview.png" alt="usage-png">
1919

2020
</div>
2121

@@ -62,6 +62,7 @@ translate <text> [options]
6262
[字符串] [默认值: "auto"]
6363
-t, --to 目标语言(要翻译的语言) 指定为语言名称或ISO 639-1代码
6464
[字符串] [默认值: "auto"]
65+
-e, --engine [字符串] [可选值: "google", "microsoft"] [默认值: "google"]
6566
--timeout 翻译请求的超时持续时间(以毫秒为单位) [数字] [默认值: 30000]
6667
--stdin-timeout 使用此参数来避免 stdin 超时 (以毫秒为单位)
6768
[数字] [默认值: 5000]
@@ -76,13 +77,11 @@ translate <text> [options]
7677
-h, --help 显示帮助信息 [布尔]
7778
```
7879

79-
<div align="center">
80-
81-
<img width="814" src="docs/images/i18n.png" alt="logo">
80+
### Environment Variables
8281

83-
i18n
84-
85-
</div>
82+
| Name | Description |
83+
|:--------------------------|:-------------|
84+
| NODE_TRANSLATE_CLI_ENGINE | 通过环境变量指定翻译引擎 |
8685

8786
## 🪄 例子
8887

@@ -199,23 +198,31 @@ translate 'Translate this sentence to your clipboard' | clipboard
199198
git commit -m "$(translate 'feat: your commit content' -t zh)"
200199
```
201200

202-
![Alt](docs/images/advanced-usage-accessor.png "Using the static accessor method")
201+
![Alt](assets/advanced-usage-accessor.png "Using the static accessor method")
203202

204203
#### 使用管道 `|` 符号
205204

206205
```shell
207206
npm info npm description | translate -t zh
208207
```
209208

210-
![Alt](docs/images/advanced-usage-pipe.png "Using the pipe | symbol")
209+
![Alt](assets/advanced-usage-pipe.png "Using the pipe | symbol")
211210

212211
#### 使用重定向 `>` 符号
213212

214213
```shell
215214
translate "这是一段测试文本。" -t en > usage.txt
216215
```
217216

218-
![Alt](docs/images/advanced-usage-redirection.png "Using the redirection > symbol")
217+
![Alt](assets/advanced-usage-redirection.png "Using the redirection > symbol")
218+
219+
#### `The Rust-lang Book` 的第一章节翻译成你的语言
220+
221+
```shell
222+
curl https://raw.githubusercontent.com/rust-lang/book/master/src/ch01-00-getting-started.md | translate
223+
```
224+
225+
![Alt](assets/advanced-usage-curl.png "Translate \"The Rust-lang Book\" into your language")
219226

220227
## 🔧 自动修正
221228

@@ -225,13 +232,13 @@ translate "这是一段测试文本。" -t en > usage.txt
225232
>
226233
> 检测语言: 红色背景
227234
228-
![Alt](docs/images/autocorrect.png "Color Scheme")
235+
![Alt](assets/autocorrect.png "Color Scheme")
229236

230237
## 🐢 网络异常
231238

232239
> 网络异常时,终端会发生下图中的变化(它们实际来自同一行内容)。
233240
234-
![Alt](docs/images/slowly-network.png "Stdout in Terminal")
241+
![Alt](assets/slowly-network.png "Stdout in Terminal")
235242

236243
## ⌨️ 自动换行
237244

@@ -243,7 +250,7 @@ translate "这是一段测试文本。" -t en > usage.txt
243250
[locale](https://github.com/kabeep/node-translate-cli/tree/master/src/locale/index.ts) 文件中贡献你的母语,
244251
或者通过 [Issues](https://github.com/kabeep/node-translate-cli/issues) 通知我处理。
245252

246-
![Alt](docs/images/i18n.png "Locale from OS")
253+
![Alt](assets/i18n.png "Locale from OS")
247254

248255
## 🔗 关联库
249256

assets/advanced-usage-curl.png

74.3 KB
Loading
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)