相信我们安装idea的大部分小伙伴都会安装如下这个插件吧~
可是突然用着用着在某一天就不好用了,当我们右键翻译的时候半天没有出来结果,反而给了一个红色提示:
有好多方案是直接更换翻译引擎,这里我就不贴出这个方案了,因为我用了也不好用,这里我使用的是另一种方案解决的,解决步骤如下:
打开系统文件夹路径 C:\Windows\System32\drivers\etc,打开后如下:
![image.png](https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/c7596cbfe9a948259ad5930a22bdfb25~tplv-k3u1fbpfcp-zoom-in-crop-mark:3024:0:0:0.image?)
这里我们打开hosts文件,在里面添加如下两行;
203.208.40.66 translate.google.com
203.208.40.66 translate.googleapis.com
即如下图
保存后我们关闭idea重新打开,再进行翻译就成功了!
当然,可能有的人会发现电脑这个路径下没有hosts文件,不过不要紧,我们可以自己新建一个host.text文件,然后将如下内容放进去:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
203.208.40.66 translate.google.com
203.208.40.66 translate.googleapis.com
然后更改文件去掉.text后缀直接保存就好。
不过这种方法都是暂时性的,过了一段时间又不好用了,我自己的方法就是切换搜索引擎,换成了有道翻译,去有道开发平台里去配置一个,不过有道翻译好像没有免费版本,只有体验版,有限额,百度有个人免费版本的,但是每月翻译字符数有限制,但是也不错
![image.png](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/7959431e85f540e6aef2f4b69d0ac72d~tplv-k3u1fbpfcp-zoom-in-crop-mark:3024:0:0:0.image?)
这里点击链接可直接跳转到指定页面申请即可,免费版本的就够我们平常使用了~
|