Skip to content

Commit 4549ad5

Browse files
committed
feat: add desc for api key input
1 parent 96633a3 commit 4549ad5

2 files changed

Lines changed: 4 additions & 16 deletions

File tree

src/info.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
"appcast": "",
1111
"minBobVersion": "0.5.0",
1212
"options": [{
13-
"identifier": "api_key",
13+
"identifier": "api_keys",
1414
"type": "text",
15-
"title": "API KEY (可以用英文逗号分割多个 key 以实现额度加倍及负载均衡)"
15+
"title": "API KEY",
16+
"desc": "可以用英文逗号分割多个 API KEY 以实现额度加倍及负载均衡"
1617
}]
1718
}

src/main.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
/**
2-
* 由于各大服务商的语言代码都不大一样,
3-
* 所以我定义了一份 Bob 专用的语言代码,以便 Bob 主程序和插件之间互传语种。
4-
* Bob 语言代码列表 https://ripperhe.gitee.io/bob/#/plugin/addtion/language
5-
*
6-
* 转换的代码建议以下面的方式实现,
7-
* `xxx` 代表服务商特有的语言代码,请替换为真实的,
8-
* 具体支持的语种数量请根据实际情况而定。
9-
*
10-
* Bob 语言代码转服务商语言代码(以为 'zh-Hans' 为例): var lang = langMap.get('zh-Hans');
11-
* 服务商语言代码转 Bob 语言代码: var standardLang = langMapReverse.get('xxx');
12-
*/
13-
141
var items = [
152
["auto", "auto"],
163
["zh-Hans", "zh"],
@@ -28,7 +15,7 @@ function supportLanguages() {
2815
}
2916

3017
function translate(query, completion) {
31-
const api_keys = $option.api_key.split(",").map((key) => key.trim());
18+
const api_keys = $option.api_keys.split(",").map((key) => key.trim());
3219
const api_key = api_keys[Math.floor(Math.random() * api_keys.length)];
3320
const header = {
3421
"Content-Type": "application/json",

0 commit comments

Comments
 (0)