What should I do if the Google Translate plug-in cannot be used?

Google Translate exits China. Currently, when accessing the original Google Translate localized domain name  link from China  , it prompts "Please bookmark our website translate.google.com.hk". However, the new website cannot be accessed from China (so it is not a problem for users who know the wall. big).

A Google spokesperson confirmed this. The company terminated the Google Translate service in mainland China due to "low usage". This change will affect the built-in translation function of the Chrome browser and applications such as KOReader.
#GoogleTranslate exits China

If you have installed the Google Translate plug-in, you will find that it suddenly does not work... When you are overwhelmed, I am glad that you can find this article.

Let’s talk about the root cause of the problem first. The fundamental reason why the Google Translate Chrome plug-in or function cannot work properly is the blocking of the Internet firewall. Using the translation function will request the API with the domain name  translate.googleapis.com  , and this domain name has become unavailable before and after Google Translate officially shut down the service.

There are currently two main solutions to this problem:

One is to map the domain name used by the API to an available IP by modifying the hosts file of the operating system.

The other is to use a network proxy so that the domain name used by the API can be accessed normally.

Method 1: Modify the hosts file

● Windows system

 

● macOS system

Method 2: Add the API to the proxy

  • Windows system

Open the cmd command in administrator mode

nslookup google.cn

Information similar to the following can be obtained

C:\WINDOWS\system32>nslookup google.cn
服务器:  UnKnown
Address:  fe80::1

非权威应答:
名称:    google.cn
Address:  xxx.xxx.xx.xx

Since the hosts file is a system file, you need to be a system administrator. It is recommended to run the "Notepad" program that comes with the system [as an administrator], and open the hosts file through [Open] in the menu according to the following path (note that the Notepad program only displays plain text files by default, so you need to change the "File" Type" must be selected as All to see the hosts file):

C:\Windows\System32\drivers\etc\hosts

Finally, as shown below, combine the IP you obtained and the domain name of the Google Translate API into a hosts rule, and add it to the last line of the hosts file. After saving the file, the plug-in can resume normal use.

输入上方Address对应的IP地址 translate.googleapis.com
  •  Mac system

Open " Terminal ", enter the following command and press Enter:

nslookup google.cn

Information similar to the following can be obtained

服务器:  UnKnown
Address:  fe80::1

非权威应答:
名称:    google.cn
Address:  xxx.xxx.xx.xx

Since the hosts file is a system file, editing it requires administrator status. It is recommended to edit the hosts file as an administrator through the vim editor that comes with the system. The specific method is to run the following command on the terminal and press Enter. After the password prompt appears, enter the login password you set for the current account and press Enter to open it.

sudo vim /etc/hosts

Finally, as shown below, combine the IP you obtained and the domain name of the Google Translate API into a hosts rule, and add it to the last line of the hosts file. After saving the file, the plug-in can resume normal use.

替换为上方address对应的IP地址 translate.googleapis.com

The specific method of adding is to first hold down the [Shift] key, then double-click the letter [G] key, position the text cursor to the last line, then press the letter [O] key to enter the insert mode, and enter (or paste) the above rules. . Finally, press the [Esc] key to exit the insert mode, enter the input  :x to save and exit the vim editor. After the file is saved successfully, the plug-in can resume normal use.

  • Add API to proxy

Add the URL rule as shown below to the proxy switching rules (for specific rules, refer to the usage provided by the specific plug-in).

*.translate.googleapis.com

Although this method can restore the word translation function of the plug-in version of Google Translate to normal, it does not apply to Chrome's built-in translation function (translate the entire web page). This is because its network request is independent and will not go through the network proxy rules set by the plug-in. . Therefore, if you want to use Chrome's built-in translation function to translate the entire web page, there are currently only two options. One is to use "Method 1" to modify the hosts file, and the other is to use a system-level global network proxy.

The method of modifying hosts is likely to be time-sensitive. If one day Google no longer provides a similar shared IP mechanism, or there are fewer and fewer IPs available, it may eventually become unusable like Google search. In the end, network proxy may be the only method left.

 

 

Guess you like

Origin blog.csdn.net/u013985879/article/details/127171677