Skip to content

Commit 7549392

Browse files
committed
upd: mp-tl to mptl
1 parent b2d32ed commit 7549392

File tree

14 files changed

+56
-56
lines changed

14 files changed

+56
-56
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 多平台终端翻译
1+
# 多翻译平台终端包
22

33
![Static Badge](https://img.shields.io/badge/npm-6.14.17-blue)
44
![Static Badge](https://img.shields.io/badge/node->=14.8.0-97CA00)
@@ -15,13 +15,13 @@
1515
## 安装
1616

1717
```
18-
npm install -g mp-tl
18+
npm install -g mptl
1919
```
2020

2121
## 使用
2222

2323
```
24-
Usage: tl command [options]
24+
Usage: mptl command [options]
2525
2626
Options:
2727
-v, --version 输出当前版本
@@ -36,36 +36,36 @@ Commands:
3636
set-langs [options] 设置源语言和目标语言
3737
-s, --source <source> 设置源语言
3838
-t, --target <target> 设置目标语言
39-
p <query...> 使用 'tl p <query...>' 指令翻译文本
39+
p <query...> 使用 'mptl p <query...>' 指令翻译文本
4040
help [command] 显示命令的帮助
4141
```
4242

4343
## 示例
4444

4545
```
46-
$ tl set-trl baidu -a 123456 -s abcdefghijklmnopqrstuvwxyz
46+
$ mptl set-trl baidu -a 123456 -s abcdefghijklmnopqrstuvwxyz
4747
4848
设置百度翻译平台的应用ID和密钥
4949
50-
$ tl ls
50+
$ mptl ls
5151
5252
查看翻译平台列表和当前选中的平台
5353
54-
$ tl use youdao
54+
$ mptl use youdao
5555
5656
使用有道翻译平台进行翻译
5757
58-
$ tl ls langs
58+
$ mptl ls langs
5959
6060
查看当前可以选择的源语言和目标语言代码
6161
62-
$ tl set-langs -s en -t zh
62+
$ mptl set-langs -s en -t zh
6363
6464
设置翻译源语言为英语,目标语言为中文
6565
66-
$ tl p hello world
66+
$ mptl p hello world
6767
68-
tl p 跟上需要翻译的文本内容
68+
mptl p 跟上需要翻译的文本内容
6969
```
7070
## 支持平台
7171

@@ -79,7 +79,7 @@ $ tl p hello world
7979
## 注意事项
8080

8181
- 翻译插件本身并没有翻译文字的能力,而是通过调用翻译平台提供的API进行翻译,目前支持的平台都有免费的翻译额度,对于大部分人来说是完全足够的。
82-
- 除了谷歌翻译,所有翻译平台都需要去申请应用ID和密钥,具体申请教程请看:[翻译平台API申请教程](https://flowus.cn/chiko_mp-tl/share/91538d60-cf6e-48a6-b2b3-bc14eed4f066?code=B8NQGQ)
82+
- 除了谷歌翻译,所有翻译平台都需要去申请应用ID和密钥,具体申请教程请看:[翻译平台API申请教程](https://flowus.cn/chiko_mptl/share/c721cbc9-6537-41e5-99b9-fd6299ec5b01?code=B8NQGQ)
8383
- 由于本插件是终端运行,也并没有提供服务器的打算,所以谷歌翻译需要通过代理才能使用,如果开启代理还不能使用,请开启代理的Tun模式。
8484

8585

README_EN.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Multi-Platform Terminal Translation
1+
# Multi-translation platform terminal package
22

33
![Static Badge](https://img.shields.io/badge/npm-6.14.17-blue)
44
![Static Badge](https://img.shields.io/badge/node->=14.8.0-97CA00)
@@ -15,13 +15,13 @@
1515
## Install
1616

1717
```
18-
npm install -g mp-tl
18+
npm install -g mptl
1919
```
2020

2121
## Usage
2222

2323
```
24-
Usage: tl command [options]
24+
Usage: mptl command [options]
2525
2626
Options:
2727
-v, --version Output the current version
@@ -36,35 +36,35 @@ Commands:
3636
set-langs [options] Set source and target languages
3737
-s, --source <source> Set source language
3838
-t, --target <target> Set target language
39-
p <query...> Translate the text using the 'tl p <query...>' directive
39+
p <query...> Translate the text using the 'mptl p <query...>' directive
4040
help [command] display help for command
4141
```
4242

4343
## Example
4444
```
45-
$ tl set-trl baidu -a 123456 -s abcdefghijklmnopqrstuvwxyz
45+
$ mptl set-trl baidu -a 123456 -s abcdefghijklmnopqrstuvwxyz
4646
4747
Set the application ID and key of Baidu Translation Platform
4848
49-
$ tl ls
49+
$ mptl ls
5050
5151
View the list of translation platforms and the currently selected platform
5252
53-
$ tl use youdao
54-
55-
Use Youdao translation platform for translation
56-
57-
$ tl ls langs
53+
$ mptl ls langs
5854
5955
View the currently available source and target language codes
6056
61-
$ tl set-langs -s en -t zh
57+
$ mptl use youdao
58+
59+
Use Youdao translation platform for translation
60+
61+
$ mptl set-langs -s en -t zh
6262
6363
Set the translation source language to English and the target language to Chinese
6464
65-
$ tl p hello world
65+
$ mptl p hello world
6666
67-
tl p Keep up with the text that needs to be translated
67+
mptl p Keep up with the text that needs to be translated
6868
```
6969
## Supported Platforms
7070

@@ -78,7 +78,7 @@ $ tl p hello world
7878
## Precautions
7979

8080
- The translation plug-in itself does not have the ability to translate text, but instead translates by calling the API provided by the translation platform. Currently supported platforms have free translation quotas, which is completely sufficient for most people.
81-
- Except for Google Translate, all translation platforms need to apply for application ID and key, Please see the specific tutorial: [Translation platform API application tutorial](https://flowus.cn/chiko_mp-tl/share/91538d60-cf6e-48a6-b2b3-bc14eed4f066?code=B8NQGQ).
81+
- Except for Google Translate, all translation platforms need to apply for application ID and key, Please see the specific tutorial: [Translation platform API application tutorial](https://flowus.cn/chiko_mptl/share/c721cbc9-6537-41e5-99b9-fd6299ec5b01?code=B8NQGQ).
8282
- Since this plug-in runs in the terminal and there is no plan to provide a server, Google Translate needs to be used through a proxy. If it still does not work after turning on the proxy, please turn on the Tun mode of the proxy.
8383

8484
## Connect

config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"key": ""
1515
},
1616
"tencent": {
17-
"name": "腾讯-tencent",
17+
"name": "腾讯云-tencent",
1818
"appid": "",
1919
"key": ""
2020
},
2121
"ali": {
22-
"name": "阿里-ali",
22+
"name": "阿里云-ali",
2323
"appid": "",
2424
"key": ""
2525
},
@@ -34,4 +34,4 @@
3434
"key": ""
3535
}
3636
}
37-
}
37+
}

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "mp-tl",
3-
"version": "2.0.1",
2+
"name": "mptl",
3+
"version": "0.0.1",
44
"type": "module",
5-
"description": "terminal translation",
6-
"main": "./dist/bin/cli.js",
5+
"description": "Terminal packages that support multiple translation platforms",
6+
"main": "./dist/cli.js",
77
"bin": {
8-
"tl": "./dist/bin/cli.js"
8+
"mptl": "./dist/cli.js"
99
},
1010
"scripts": {
1111
"start": "tsc-watch --onSuccess \"tsc-alias\"",
@@ -14,7 +14,7 @@
1414
"test": "echo \"Error: no test specified\" && exit 1"
1515
},
1616
"exports": {
17-
".": "./dist/bin/cli.js"
17+
".": "./dist/cli.js"
1818
},
1919
"engines": {
2020
"node": ">=14.8.0"
@@ -25,8 +25,7 @@
2525
"README_EN.md"
2626
],
2727
"keywords": [
28-
"tl",
29-
"mp-tl",
28+
"mptl",
3029
"translate",
3130
"translation",
3231
"translator",

src/bin/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export { Baidu } from "@bin/baidu";
2+
export { Google } from "@bin/google";
3+
export { Youdao } from "@bin/youdao";
4+
export { Tencent } from "@bin/tencent";
5+
export { Ali } from "@bin/ali";
6+
export { Volcengine } from "@bin/volcengine";

src/bin/langs.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export { default as baidu } from "@bin/baidu/langs";
2+
export { default as google } from "@bin/google/langs";
3+
export { default as youdao } from "@bin/youdao/langs";
4+
export { default as tencent } from "@bin/tencent/langs";
5+
export { default as ali } from "@bin/ali/langs";
6+
export { default as volcengine } from "@bin/volcengine/langs";

src/bin/platform/ali/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class Ali implements Tl.Methods {
88
private mTitle: string;
99
constructor(name: string) {
1010
this.mName = name;
11-
this.mTitle = "阿里翻译";
11+
this.mTitle = "阿里云翻译";
1212
}
1313

1414
async translate(query: string[]) {

src/bin/platform/index.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/bin/platform/langs.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/bin/platform/tencent/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class Tencent implements Tl.Methods {
66
private mTitle: string;
77
constructor(name: string) {
88
this.mName = name;
9-
this.mTitle = "腾讯翻译";
9+
this.mTitle = "腾讯云翻译";
1010
}
1111

1212
printError(code: string) {

0 commit comments

Comments
 (0)