Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Easydict v2.9.3] 🐞 fix: bing host is incorrect if check ip failed #14448

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions extensions/easydict/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# `Easydict` Changelog

## [v2.9.3] - 2024-09-13

### 🐞 Fixed

- Fixed Bing language detection API failed, which caused the query process to hang. https://github.com/raycast/extensions/issues/14357

## [v2.9.2] - 2024-08-25

### 💎 Improvement

- Support HTTP OpenAI API endpoint, thanks to [rookiezn](https://github.com/rookiezn)'s PR.
- Support changing OpenAI model, default to use `gpt-4o-mini`.
- DeepL translation supports Arabic language.
- Removed the deprecated built-in DeepL API key.
- Removed support for the official Youdao translation API, now only use the web API by default.
Expand Down
40 changes: 32 additions & 8 deletions extensions/easydict/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,29 @@
}
]
},
{
"title": "Bing Host",
"name": "bingHost",
"type": "dropdown",
"label": "Bing Host",
"required": false,
"description": "Bing Host Type",
"default": "",
"data": [
{
"title": "Auto",
"value": ""
},
{
"title": "cn.bing.com",
"value": "cn.bing.com"
},
{
"title": "www.bing.com",
"value": "www.bing.com"
}
]
},
{
"title": "Switch Boxes",
"name": "enableAutomaticQuerySelectedText",
Expand All @@ -537,14 +560,6 @@
"description": "Turned on by default, the speed and accuracy of language detection is well balanced. Turn off if you want more accurate language detection, but slower ⚠️ .",
"default": true
},
{
"name": "enableBaiduLanguageDetect",
"type": "checkbox",
"label": "Enable Baidu Language Detect",
"required": false,
"description": "⚠️ If turn off it, the language detection will be slower, even cause timeout.",
"default": true
},
{
"name": "enableAutomaticPlayWordAudio",
"type": "checkbox",
Expand All @@ -569,6 +584,15 @@
"description": "⚠️ Note that it should only be enabled if needed, as it can slow down requests.",
"default": false
},
{
"title": "Langauge Detection",
"name": "enableBaiduLanguageDetect",
"type": "checkbox",
"label": "Enable Baidu Language Detect",
"required": false,
"description": "Turn on/off Baidu Language Detect.",
"default": true
},
{
"title": "Apple System Features",
"name": "enableAppleTranslate",
Expand Down
89 changes: 0 additions & 89 deletions extensions/easydict/src/checkIP.ts

This file was deleted.

25 changes: 0 additions & 25 deletions extensions/easydict/src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,4 @@ export const userAgent =

export const clipboardQueryTextKey = "clipboardQueryTextKey";

export const isChineseIPKey = "isChineseIP";

export const networkTimeout = 15000;

export enum YoudaoErrorCode {
Success = "0",
TargetLanguageNotSupported = "102",
TranslatedTextTooLong = "103",
InvalidApplicationID = "108", // 应用ID无效
InvalidSignature = "202", // 签名无效,AppSecret不正确
AccessFrequencyLimited = "207",
TranslationQueryFailed = "302", // 翻译查询失败, such as 'con' 😓
InsufficientAccountBalance = "401",
}

// https://fanyi-api.baidu.com/doc/21
export enum BaiduErrorCode {
Success = "52000",
AccessFrequencyLimited = "54003",
InsufficientAccountBalance = "54004",
TargetLanguageNotSupported = "58001",
}

export const youdaoErrorCodeUrl = encodeURI(
"https://ai.youdao.com/DOCSIRMA/html/自然语言翻译/API文档/文本翻译服务/文本翻译服务-API文档.html#section-11"
);
2 changes: 2 additions & 0 deletions extensions/easydict/src/preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export interface MyPreferences {
openAIAPIKey: string;
openAIAPIURL: string;
openAIModel: string;

bingHost: string;
}

/**
Expand Down
20 changes: 9 additions & 11 deletions extensions/easydict/src/releaseVersion/versionInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,25 @@ export class Easydict {
static repo = "Raycast-Easydict";

// * NOTE: this is new version info, don't use it directly. Use getCurrentStoredVersionInfo() instead.
version = "2.9.2";
buildNumber = 28;
versionDate = "2024-08-25";
version = "2.9.3";
buildNumber = 29;
versionDate = "2024-09-13";
isNeedPrompt = true;
hasPrompted = false; // * always default false, only show once, then should be set to true.

releaseMarkdown = `
## [v${this.version}] - ${this.versionDate}

### 💎 优化
### 🐞 修复

- 支持 HTTP OpenAI API endpoint,感谢 [rookiezn](https://github.com/rookiezn) 的 PR https://github.com/tisfeng/Raycast-Easydict/pull/51。
- DeepL 翻译支持阿拉伯语 AR。
- 移除了已废弃的内置的 DeepL API key。
- 移除了对有道翻译官方 API 的支持,现默认只使用网页 API。
- 修复了 Bing 语种识别 API 失败,导致查询过程卡住问题。https://github.com/raycast/extensions/issues/14357

### 🐞 修复
---

- 修复了 argument 参数可能丢失问题。https://github.com/tisfeng/Raycast-Easydict/pull/63
`;
### 🐞 Fixed

- Fixed Bing language detection API failed, which caused the query process to hang. https://github.com/raycast/extensions/issues/14357
`;
getRepoUrl() {
return `${githubUrl}/${Easydict.author}/${Easydict.repo}`;
}
Expand Down
Loading
Loading