6

快速解决谷歌浏览器自带翻译不好用的问题 - jvx

 1 year ago
source link: https://www.cnblogs.com/j4587698/p/16802028.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

快速解决谷歌浏览器自带翻译不好用的问题

先说工具,我写了一个小工具,可以快速修改,不需要任何其他知识。

chrometranslate.png

其中"修改的Ip"为本次你要修改的Ip地址,如果之前你已经修改过了,这里会显示现在的IP,如果没有,这里是空的。

如果你有更合适的IP,可以在这里直接填写IP,如果没有,可以点击右侧的"查询推荐Ip",会获取一个可用Ip。

点击“确认修改”即可生效。

然后尝试一下是否可以用了?就是这么简单。

注意,由于Host文件的修改需要管理员权限,所以程序启动时需要管理员权限。请允许程序获取管理员权限。

下载地址:https://wwm.lanzoub.com/iCWv40e31f3c

密码:6o95

软件使用c# 编写,平台为.net framework 4.6.2,大部分win7以上的电脑应该都已经自带了对应的运行时,可以直接用。

代码在github:https://github.com/j4587698/ChromeTranslate

由于目前谷歌关闭了国内的翻译服务,所以目前谷歌浏览器默认的translate.googleapis.com已经无法正常获取到数据。所以一直都是翻译失败。

但是目前translate.google.cn还在服务,这个服务也支持api的调用。所以我们可以简单的把translate.googleapis.com指向translate.google.cn的ip。

这样就可以继续使用谷歌浏览器自带的翻译服务了。

目前程序的查询推荐IP就是通过dns查询获取translate.google.cn对应的地址,你也可以使用其他的方式,比如各种站长工具基本都有全国ping,看下ping出来的Ip地址,然后用这个ip来修改。

然后需要将ip写入host文件,默认host文件的位置为

你的windows文件夹\System32\drivers\etc\hosts

注意,hosts这个文件没有扩展名,就叫hosts。

然后打开hosts文件,注意要使用管理员权限打开,否则的话无法保存,hosts文件非管理员时只读的。

最后在hosts文件中添加

查询到的IP		translate.googleapis.com

比如我就写

180.163.151.34		translate.googleapis.com

获取ip:

var ips = Dns.GetHostAddresses("translate.google.cn");

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK