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

请问如何使用这个库 #1

Open
YoursOwen opened this issue Jan 12, 2022 · 10 comments
Open

请问如何使用这个库 #1

YoursOwen opened this issue Jan 12, 2022 · 10 comments

Comments

@YoursOwen
Copy link

请问如何使用这个库

@intellism
Copy link
Owner

这是一个vscode 插件。https://marketplace.visualstudio.com/items?itemName=intellsmi.deepl-translate
他是为 comment translate插件提供翻译服务的, https://marketplace.visualstudio.com/items?itemName=intellsmi.comment-translate

如果你是需要deepl翻译vscode的代码,可以安装上面两个插件。

如果你是插件开发者,也可以实现相关协议,使用这个插件提供服务。

@morelearn1990
Copy link

安装上之后选择翻译源,没有这个插件提供的翻译源选项

@intellism
Copy link
Owner

intellism commented Jan 25, 2022

安装上之后选择翻译源,没有这个插件提供的翻译源选项

需要重启vscode,选择翻译源就可以看到选项了。
image
image

参看这个插件的配置,还需要自行申请请求KEY。国内用户比较麻烦,需要visa信用卡认证。

@fsleo
Copy link

fsleo commented Jul 26, 2022

我使用Google baidu bing 都不能用,比如baidu提示:
[Start translate]: Use 'Baidu' translate source
[Baidu]: request error:
[object Object]
Try again later or change translate source.{"errno":1022,"errmsg":"访问出现异常,请刷新后重试!","error":1022,"errShowMsg":"访问出现异常,请刷新后重试!"}

[Start translate]: Use 'Bing' translate source
[Bing]: request error:
RequestError: connect ETIMEDOUT 204.79.197.200:443
Try again later or change translate source.{"name":"RequestError","code":"ETIMEDOUT","timings":{"start":1658850838163,"socket":1658850838166,"lookup":1658850838168,"error":1658850913170,"phases":{"wait":3,"dns":2,"total":75007}}}

@intellism
Copy link
Owner

我使用Google baidu bing 都不能用,比如baidu提示: [Start translate]: Use 'Baidu' translate source [Baidu]: request error: [object Object] Try again later or change translate source.{"errno":1022,"errmsg":"访问出现异常,请刷新后重试!","error":1022,"errShowMsg":"访问出现异常,请刷新后重试!"}

[Start translate]: Use 'Bing' translate source [Bing]: request error: RequestError: connect ETIMEDOUT 204.79.197.200:443 Try again later or change translate source.{"name":"RequestError","code":"ETIMEDOUT","timings":{"start":1658850838163,"socket":1658850838166,"lookup":1658850838168,"error":1658850913170,"phases":{"wait":3,"dns":2,"total":75007}}}

检查下是否开有代理。

@fsleo
Copy link

fsleo commented Jul 28, 2022

我昨天用bing,有一段时间是可以的,而且还很快,但是后来又不行了。
我是有用代理,但是我关掉后,还是不行,vscode 里也可以设置代理,但是我从来没有设置过。

[Baidu]: request error:
[object Object]
Try again later or change translate source.{"errno":1022,"errmsg":"访问出现异常,请刷新后重试!","error":1022,"errShowMsg":"访问出现异常,请刷新后重试!"}

[Google]: request error:
TimeoutError: Timeout awaiting 'request' for 10000ms
Try again later or change translate source.{"code":"ETIMEDOUT","timings":{"start":1658981656201,"socket":1658981656203,"lookup":1658981656205,"connect":1658981656369,"error":1658981666202,"phases":{"wait":2,"dns":2,"tcp":164,"total":10001}},"name":"TimeoutError","options":{"agent":{},"decompress":true,"timeout":{"request":10000},"prefixUrl":"","ignoreInvalidCookies":false,"context":{},"hooks":{"init":[],"beforeRequest":[],"beforeError":[],"beforeRedirect":[],"beforeRetry":[],"afterResponse":[]},"followRedirect":true,"maxRedirects":10,"throwHttpErrors":true,"username":"","password":"","http2":false,"allowGetBody":false,"headers":{"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36","accept":"application/json","accept-encoding":"gzip, deflate, br"},"methodRewriting":false,"retry":{"limit":2,"methods":["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],"statusCodes":[408,413,429,500,502,503,504,521,522,524],"errorCodes":["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],"backoffLimit":null,"noise":100},"method":"GET","cacheOptions":{},"https":{},"resolveBodyOnly":false,"isStream":false,"responseType":"text","url":"https://translate.google.com/translate_a/single?client=gtx&sl=auto&tl=zh-CN&hl=zh-CN&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=7&q=Return&tk=31089.31089","pagination":{"countLimit":null,"backoff":0,"requestLimit":10000,"stackAllItems":false},"setHost":true},

[Start translate]: Use 'Bing' translate source
[Bing]: request error:
RequestError: connect ETIMEDOUT 204.79.197.200:443
Try again later or change translate source.{"name":"RequestError","code":"ETIMEDOUT","timings":{"start":1658981462796,"socket":1658981462798,"lookup":1658981462799,"error":1658981537800,"phases":{"wait":2,"dns":1,"total":75004}}}

@fsleo
Copy link

fsleo commented Jul 28, 2022

image

但是我点这里,都可以开的,baidu/google/bing

@fsleo
Copy link

fsleo commented Jul 28, 2022

image

另外,日志里是 google.com / 从箭头那里打开又是 google.cn(当然我有设置google 是要.cn 要不打不开)

@intellism
Copy link
Owner

比较奇怪了。 都是超时。 你尝试下安装其他需要网络请求的插件,看看是不是因为vscode网络请求授权的问题还是什么原因。

@MangoFF
Copy link

MangoFF commented Apr 4, 2023

我也是这样,[Baidu]: request error:
[object Object]
Try again later or change translate source.{"errno":1022,"errmsg":"访问出现异常,请刷新后重试!","error":1022,"errShowMsg":"访问出现异常,请刷新后重试!"}
其他几个也跟上面类似,使用了代理,在windows上安装就可以体验了很丝滑。但是在Mac上就用不了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants