Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng committed Dec 19, 2023
1 parent 1645498 commit 0011ea1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 55 deletions.
44 changes: 23 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,17 @@ Easydict 自动支持词典 App 中系统自带的词典,如牛津英汉汉英

#### 配置 APIKey

```
```bash
easydict://writeKeyValue?EZOpenAIAPIKey=sk-xxx
```

<div>
<img src="https://raw.githubusercontent.com/tisfeng/ImageBed/main/uPic/image-20231104131750966-1699075071.png" width="50%" />
</div>

查看 APIKey (其他 key 类似),如果查询成功,会将结果写到剪贴板。
```

```bash
easydict://readValueOfKey?EZOpenAIAPIKey
```

Expand All @@ -367,11 +369,11 @@ easydict://readValueOfKey?EZOpenAIAPIKey

考虑到 OpenAI 的 token 费用因素,因此提供默认关闭选项,写入下面命令后,OpenAI 将默认关闭查询,仅在用户手动点击展开按钮时才查询

```
```bash
easydict://writeKeyValue?EZOpenAIServiceUsageStatusKey=1
```

```
```bash
// 关闭查单词
easydict://writeKeyValue?EZOpenAIDictionaryKey=0

Expand All @@ -387,7 +389,7 @@ easydict://writeKeyValue?EZOpenAISentenceKey=0

支持设置自定义域名和模型

```
```bash
// xxx 是 host,默认是 api.openai.com
easydict://writeKeyValue?EZOpenAIDomainKey=xxx

Expand All @@ -413,19 +415,19 @@ DeepL 免费版网页 API 对用户单个 IP 有频率限制,频繁使用会

在输入框输入下面代码,xxx 是你的 DeepL AuthKey,然后 Enter

```
```bash
easydict://writeKeyValue?EZDeepLAuthKey=xxx
```

#### 自定义 DeepL 接口地址

如果没有自己的 AuthKey,又需要大量使用 DeepL 翻译,那么可以考虑自己部署支持 DeepL 的接口服务,或者使用支持 DeepL 的第三方服务。

这种情况需要设置自定义 DeepL 接口地址,其中 EZDeepLTranslateEndPointKey 的值应该是完整的请求 URL,例如 DeepL 官方接口是 https://api-free.deepl.com/v2/translate如果自定义接口需要 AuthKey,配置方式和前面一样,接口参数和 DeepL 官方保持一致。
这种情况需要设置自定义 DeepL 接口地址,其中 EZDeepLTranslateEndPointKey 的值应该是完整的请求 URL,例如 DeepL 官方接口是 https://api-free.deepl.com/v2/translate ,如果自定义接口需要 AuthKey,配置方式和前面一样,接口参数和 DeepL 官方保持一致。

自定义 DeepL 接口地址的方式,在 Easydict 程序中等同于 DeepL 官方 AuthKey API 形式。
使用自定义 DeepL 接口地址的方式,在 Easydict 程序中等同于 DeepL 官方 AuthKey API 形式。

```
```bash
easydict://writeKeyValue?EZDeepLTranslateEndPointKey=xxx
```
借助下面开源项目,可以在自己的服务器或者 Cloudflare 上部署支持 DeepL 翻译的接口服务:
Expand All @@ -438,19 +440,19 @@ easydict://writeKeyValue?EZDeepLTranslateEndPointKey=xxx

1. 默认优先使用网页版 API,在网页版 API 失败时会使用个人的 AuthKey(如果有)

```
```bash
easydict://writeKeyValue?EZDeepLTranslationAPIKey=0
```

2. 优先使用个人的 AuthKey,失败时使用网页版 API。若高频率使用 DeepL,建议使用这种方式,能减少一次失败的请求,提高响应速度。

```
```bash
easydict://writeKeyValue?EZDeepLTranslationAPIKey=1
```

3. 只使用个人的 AuthKey

```
```bash
easydict://writeKeyValue?EZDeepLTranslationAPIKey=2
```

Expand All @@ -460,7 +462,7 @@ easydict://writeKeyValue?EZDeepLTranslationAPIKey=2

建议使用自己的 API key,每个注册用户腾讯翻译每月赠送 500 万字符流量,足以日常使用了。

```
```bash
// xxx 腾讯翻译的 SecretId
easydict://writeKeyValue?EZTencentSecretId=xxx

Expand All @@ -480,7 +482,7 @@ cookieStore.get("MUID").then(result => console.log(encodeURIComponent("MUID=" +

最后将 cookie 使用命令写入 Easydict

```
```bash
// xxx 是前面获取的 cookie
easydict://writeKeyValue?EZBingCookieKey=xxx
```
Expand All @@ -491,9 +493,9 @@ easydict://writeKeyValue?EZBingCookieKey=xxx

[小牛翻译](https://niutrans.com/) 需要 API key,为使用方便,我们内置了一个 key,这个 key 有额度限制,不保证一直能用。

建议使用自己的 API key,每个注册用户小牛翻译每日赠送 20 万字符流量,足以日常使用了
建议使用自己的 API key,每个注册用户小牛翻译每日赠送 20 万字符流量。

```
```bash
// xxx 小牛翻译的 APIKey
easydict://writeKeyValue?EZNiuTransAPIKey=xxx
```
Expand All @@ -502,9 +504,9 @@ easydict://writeKeyValue?EZNiuTransAPIKey=xxx

[彩云小译](https://fanyi.caiyunapp.com/) 需要 Token,为使用方便,我们内置了一个 token,这个 token 有一定限制,不保证一直能用。

建议使用自己的 Token,新用户注册会获得 100 万字的免费翻译额度,足以日常使用了
建议使用自己的 Token,新用户注册会获得 100 万字的免费翻译额度。

```
```bash
// xxx 彩云小译的 Token
easydict://writeKeyValue?EZCaiyunToken=xxx
```
Expand All @@ -530,19 +532,19 @@ Easydict 可以根据查询文本的内容,自动启用相应的查询服务
默认情况下,所有的翻译服务都支持单词查询(单词也属于文本的一种),用户可以手动调整,如设置 Google 智能模式只翻译文本,只需要使用下面命令修改为 `translation | sentence` 即可。
```
```bash
easydict://writeKeyValue?Google-IntelligentQueryTextType=5
```

同样,对于一些同时支持查询单词和翻译文本的服务,如有道词典,也可以设置它智能模式只查询单词,设置类型为 `dictionary`

```
```bash
easydict://writeKeyValue?Youdao-IntelligentQueryTextType=2
```

默认情况下,只有【迷你窗口】启用了智能查询模式,用户也可以手动对【侧悬浮窗口】启用智能查询模式:

```
```bash
easydict://writeKeyValue?IntelligentQueryMode-window2=1
```
window1 代表迷你窗口,window2 代表侧悬浮窗口,赋值 0 表示关闭,1 表示开启。
Expand Down
54 changes: 20 additions & 34 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
- [Configure AuthKey](#configure-authkey)
- [Configure API endpoint](#configure-api-endpoint)
- [Configure API call method](#configure-api-call-method)
- [腾讯翻译](#腾讯翻译)
- [Tencent Translate](#tencent-translate)
- [Bing Translate](#bing-translate)
- [Niutrans](#niutrans)
Expand Down Expand Up @@ -342,7 +341,7 @@ Please make sure you have an APIKey.

#### Configure APIKey

```
```bash
easydict://writeKeyValue?EZOpenAIAPIKey=sk-xxx
```

Expand All @@ -351,7 +350,8 @@ easydict://writeKeyValue?EZOpenAIAPIKey=sk-xxx
</div>

Lookup for APIKey (similar to other keys), if the query succeeds, the result will be written to the clipboard.
```

```bash
easydict://readValueOfKey?EZOpenAIAPIKey
```

Expand All @@ -367,11 +367,11 @@ Currently, OpenAI translation supports three query modes: word lookup, sentence

Considering the token cost associated with OpenAI, a default 'Close' option has been implemented. After executing the following command, OpenAI will automatically stop the queries by default, and it will only be queried when the user manually clicks the 'Expand' button.

```
```bash
easydict://writeKeyValue?EZOpenAIServiceUsageStatusKey=1
```

```
```bash
// Disable word lookup
easydict://writeKeyValue?EZOpenAIDictionaryKey=0

Expand All @@ -387,7 +387,7 @@ A quick tip: If you only want to exclude occasional sentence analysis without tu

Support custom domains and models

```
```bash
// xxx is the host, the default one is api.openai.com
easydict://writeKeyValue?EZOpenAIDomainKey=xxx

Expand All @@ -413,7 +413,7 @@ If you have DeepL AuthKey, it is recommended to use personal AuthKey, so as to a

Enter the following code in the input box, xxx is your DeepL AuthKey, and then Enter

```
```bash
easydict://writeKeyValue?EZDeepLAuthKey=xxx
```

Expand All @@ -425,7 +425,7 @@ In this case, you need to set a custom DeepL interface address, where the value

The way to customize the DeepL interface address is equivalent to the DeepL official AuthKey API form in the Easydict program.

```
```bash
easydict://writeKeyValue?EZDeepLTranslateEndPointKey=xxx
```

Expand All @@ -438,43 +438,29 @@ With the help of the following open source projects, you can deploy a DeepL tran

1. The web version API is used by default, and the personal AuthKey will be used when the web version API fails (if any)

```
```bash
easydict://writeKeyValue?EZDeepLTranslationAPIKey=0
```

2. Use personal AuthKey first, and use web version API when it fails. If you use DeepL frequently, it is recommended to use this method, which can reduce one failed request and improve response speed.

```
```bash
easydict://writeKeyValue?EZDeepLTranslationAPIKey=1
```

3. Only use personal AuthKey

```
```bash
easydict://writeKeyValue?EZDeepLTranslationAPIKey=2
```

### 腾讯翻译

[腾讯翻译](https://fanyi.qq.com/) 需要 API key,为使用方便,我们内置了一个 key,这个 key 有额度限制,不保证一直能用。

建议使用自己的 API key,每个注册用户腾讯翻译每月赠送 500 万字符流量,足以日常使用了。

```
// xxx 腾讯翻译的 SecretId
easydict://writeKeyValue?EZTencentSecretId=xxx
// xxx 腾讯翻译的 SecretKey
easydict://writeKeyValue?EZTencentSecretKey=xxx
```

### Tencent Translate

[Tencent Translate](https://fanyi.qq.com/) requires an APIKey, for ease of use, we have built-in a key, this key has a limit on the amount, not guaranteed to be available all the time.

It is recommended to use your own APIKey, each registered user of Tencent Translate is given 5 million characters of traffic per month, which is enough for daily use.

```
```bash
// xxx is the SecretId of Tencent Translate
easydict://writeKeyValue?EZTencentSecretId=xxx

Expand All @@ -494,7 +480,7 @@ cookieStore.get("MUID").then(result => console.log(encodeURIComponent("MUID=" +r

Finally, use the command to write the cookie in Easydict

```
```bash
// xxx is the obtained cookie
easydict://writeKeyValue?EZBingCookieKey=xxx
```
Expand All @@ -505,9 +491,9 @@ easydict://writeKeyValue?EZBingCookieKey=xxx

[Niutrans](https://niutrans.com/) requires an API key, for ease of use, we have built-in a key, this key has a limit on the amount, not guaranteed to be available all the time.

It is recommended to use your own API key, each registered user of Niutrans is given 200,000 characters of traffic per day, which is enough for daily use.
It is recommended to use your own API key, each registered user of Niutrans is given 200,000 characters of traffic per day.

```
```bash
// xxx is the APIKey of Niutrans
easydict://writeKeyValue?EZNiuTransAPIKey=xxx
```
Expand All @@ -516,9 +502,9 @@ easydict://writeKeyValue?EZNiuTransAPIKey=xxx

[Lingocloud](https://fanyi.caiyunapp.com/#/) needs an Token, for ease of use, we have built-in a token, this token has a limit on the amount, not guaranteed to be available all the time.

It is recommended to use your own Token, each registered user of Lingocloud is given 100,000 characters of traffic per day, which is enough for daily use.
It is recommended to use your own Token, each registered user of Lingocloud is given 100,000 characters of traffic per day.

```
```bash
// xxx is the Token of Lingocloud
easydict://writeKeyValue?EZCaiyunToken=xxx
```
Expand All @@ -544,19 +530,19 @@ For vocabularies, services that support vocabularies lookup work significantly b
By default, all translation services support vocabularies lookup (vocabularies are also a kind of text), users can adjust it manually. For example, to set Google to translate text only, just use the following command to change the property to `translation | sentence`.
```
```bash
easydict://writeKeyValue?Google-IntelligentQueryTextType=5
```

Similarly, for some services that support looking up vocabulary and translating text at the same time, such as Youdao Dictionary, you can set its query mode to look up only vocabulary by setting the type to `dictionary`.

```
```bash
easydict://writeKeyValue?Youdao-IntelligentQueryTextType=2
```

By default, only [Mini Window] is enabled for Smart Query Mode, users can also enable Smart Query Mode manually for [Hover Window]:

```
```bash
easydict://writeKeyValue?IntelligentQueryMode-window2=1
```
window1 represents the mini window, while window2 represents hover window, value 0 represents disabled, while 1 represents enabled.
Expand Down

0 comments on commit 0011ea1

Please sign in to comment.