fix(translation): 微软翻译免费接口下线,改用谷歌免费端点修复 - #697
Open
codedogQBY wants to merge 1 commit into
Open
Conversation
- 微软 edge.microsoft.com/translate/auth 已返回 404(上游下线,网上 30+ 项目同款问题) - 新增 googleTranslate():translate.googleapis.com/translate_a/single?client=gtx,无需 API key - microsoftTranslate 保留名称/签名,内部转调谷歌端点,UI/provider 无感知 - 支持长文本分批(4500 字符/段)、15s 超时、空结果/异常 JSON 处理 - 测试 4 个通过,全量 584 个通过
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
用户反馈:微软翻译(免费)报错 Failed to get Microsoft translate token: 404
根因
微软已于近期关闭免费 Edge 翻译的 auth 通道(
edge.microsoft.com/translate/auth返回 404)。全球 30+ 开源项目同款问题(bing-translate-api #47、TranslationPlugin #6451、pot-desktop #1024 等),属上游 API 变更,非 ReadAny 自身 bug。修复
googleTranslate():使用无需 API key 的translate.googleapis.com/translate_a/single?client=gtxmicrosoftTranslate()保留名称/签名,内部转调谷歌端点——UI 和 Provider 层无感知验证
风险
谷歌 gtx 为非官方免费接口,存在限流或未来变更风险(社区通用做法,各翻译插件均如此);如未来失效可切换到付费 Microsoft Translator(需 API key)