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
55A 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
198206git 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
206214npm 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
214222translate " 这是一段测试文本。" -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
244260Quickly contribute your language via ease-to-use [ node-translate-i18n] ( https://github.com/kabeep/node-translate-i18n )
245261in [ locale] ( https://github.com/kabeep/node-translate-cli/tree/master/src/locale/index.ts ) file are welcome,
246262or 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
0 commit comments