Excellent software and practical tutorials
How to use Google Translate on Chrome
Chinese web versionGoogle TranslateWhen it is not available, you can select the word to translate. Google Translate Chrome Extension as well as Chrome Built-in web translation function Also it doesn't work properly anymore.PluginsThe Google Translate version will not respond after translating a word, and the web translation function built into Chrome will prompt that the webpage cannot be translated.
Google A Translate spokesperson said that Google Translate has officially withdrawn from China due to "too low usage of Translate". If you visit the Google Translate homepage now, you will see a page prompting you to use Hong Kong Google Translate. Clicking on the link on the page will take you to the Hong Kong Google Translate page. Of course, if you don't use the Internet,Network ProxyIt is unusable. This undoubtedly brings inconvenience to those who need to use Google Translate.
After Google Translate withdrew from China, the simplest solution is to useMicrosoftof Microsoft Edge, Microsoft Edge has a built-in translation function, and you can alsoGoogle ChromeImport bookmarks into Microsoft Edge with one click. If you don't want to use Microsoft Edge, here's how to use it.Google Chrome Google Translate for Chrome.
Before introducing the specific solution, let's first explain the cause of this problem. The fundamental reason why Chrome's translation function cannot work properly is that the Internet firewall is blocking it. Using the translation function will request the domain name translate.googleapis.com The domain name was no longer available around the time when Google Translate officially shut down its service.
What if Google Translate is no longer available? What if Chrome's built-in translation is no longer available? For these two problems, Shuban provides two effective solutions. One is to modify the hosts file of the operating system to map the domain name used by the API to an available IP address, and the other is to useacting, so that the domain name used by the API can be accessed normally.
You can restore Chrome's translation function by following the steps below or using the handy gadget provided by Book Companion.
Method 1: Modify the hosts file
The IP addresses used by Google's websites in China are shared, including Google Translate, so as long as you can find the domain name of the Google service you can access normally, such asGoogle China Home Page, Adsense ads that can be loaded normally on the web page, or the URL of the JavaScript script file used by Analytics statistics, etc., you can easily obtain an IP address that can be used normally in your network environment. After obtaining an available IP address, add it to the hosts file of the operating system to map it to the domain name used by the Google Translate API, and the Chrome translation function can be used normally.
The following are methods for obtaining available IP addresses and modifying them. Windows System and macOS Specific method of system hosts file.
● Windows system (automatically modified)
To simplify the operation, Shuban has written the steps of manually modifying the hosts file into a batch script, which can complete all the modification steps with just one click. The script is hosted on GitHub Gist You can also download it directly to your local computer through the following link.
- Download batch script:fix-google-translate-cn.bat
The usage is very simple, download andUnzip, right-click on the batch file, and click [Run as Administrator】. If you see the prompt as shown below, it means the rule has been added successfully and Chrome translation has returned to normal.
Adding the rule "180.163.150.34 translate.googleapis.com" Done. Press any key to continue...
This script can be used repeatedly. After adding rules, an interactive prompt message will appear when you use it again. Enter 1 It will try to update the IP address of the added rule. If there is no change, no modification will be made. Enter 2 The added rules will be deleted.
● Windows system (manual modification)
The method to obtain an available IP address in Windows is to open the "Command Prompt", enter the following command and press Enter:
nslookup google.cn
If the network is normal, you can get information similar to the following, where the last line is the available IP address:
Server: 8.8.8.8 Address: 8.8.8.8#53 Non-authoritative answer: Name: google.cn Address: 180.163.151.34
Since the hosts file is a system file, you need to use the system administrator identity.Run as Administrator】The system comes with "Notepad" program, through its menu [Open】Open the hosts file according to the following path (note that the Notepad program only displays text files by default, and you need to change the "File Type"You need to select All to see the hosts file):
C:\Windows\System32\drivers\etc\hosts
Finally, combine the IP address you obtained and the domain name of the Google Translate API into a hosts rule as shown below, and add it to the last line of the hosts file. After saving the file, the Chrome translation function can be restored to normal use.
180.163.151.34 translate.googleapis.com
If you want to delete the added rule in the future, just open the hosts file and delete it, just like when you added it.
● macOS system (automatically modified)
To simplify the operation, Shuban has written the steps of manually modifying the hosts file into a Shell script, which can complete all the modification steps with just one click. The script is hosted on GitHub Gist You can download it for local use, or use the simpler method below.
Open"terminal", copy the following command and paste it into the terminal, press Enter, enter your system password, and press Enter again. Note that no information is displayed when entering the password, just make sure the password you enter is correct.
sudo bash -c "$(curl -skL https://fere.link/ow3cld)"
If you see the prompt as shown below, it means the rule has been added successfully and you can use Chrome's Google Translate function normally.
Adding the rule "180.163.151.162 translate.googleapis.com" Done.
* Tip: The way to open the terminal is to open "Finder”, find and enter “Applications" folder, find and enter "Utilities" folder, where you can find "Terminal”, double-click to open it.
* Note: Since the code is hosted on GitHub Therefore, you may encounter network problems when requesting a URL. If there is no response for a long time after running the command, it is recommended to press Ctrl + C to terminate the operation, and then re-run the above command. Generally, you can try it two or three times at most.
This command can be used repeatedly. After adding a rule, an interactive prompt message will appear when you use it again. Enter 1 It will try to update the IP address of the added rule. If there is no change, no modification will be made. Enter 2 The added rules will be deleted.
● macOS system (manual modification)
The method to obtain available IP in macOS system is to open "terminal", enter the following command and press Enter:
nslookup google.cn
If the network is normal, you can get information similar to the following, where the last line is the available IP address:
Server: 8.8.8.8 Address: 8.8.8.8#53 Non-authoritative answer: Name: google.cn Address: 180.163.151.34
Since the hosts file is a system file, you need to be an administrator to edit it. It is recommended to use the system's built-in vim Open the hosts file in the editor. To do this, run the following command on the terminal and press Enter. When 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 address 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 Chrome translation function can be restored to normal use.
180.163.151.34 translate.googleapis.com
The specific method to add is to first press and hold [Shift】key, then double-click the letter 【G】key to position the text cursor to the last line, and then press the letter 【O】key to enter insert mode and enter (or paste) the above rules. Finally, press 【Esc】key to exit insert mode, enter 😡 to save and exit the vim editor. After the file is saved successfully, the Chrome translation function will return to normal.
If you want to delete the added rule in the future, just open the hosts file and delete it, just like when you added it.
● Kindle system
If your Kindle has been jailbroken and KOReader has been installed, you may be using its built-in Google Translate feature. Since this feature also relies on the Google Translate API, you need to modify the Kindle system's hosts file to restore it to normal.
Similarly, you can modify the hosts file of the Kindle system automatically or manually through the tools provided by Shuban.
One-click fix for Google Translate in KOReader
Google Translate withdraws from ChinaAfter that, not only the web version is unusable, but also the Google Translate API that many software rely on is unusable, including KOReader. Fortunately, it can be fixed by modifying the Kindle system hosts file.
Because the hosts file is a system file, your Kindle must be jailbroken to modify it. Here are two methods to modify the hosts file. You can choose which one to use based on your preference.
Method 1: Automatically modify the hosts file
To simplify the operation, BookBan has put the function of repairing Google Translate into the plug-in toolkit BookFere Tools.
You can install KUAL first, then download the compressed file from the link provided below, unzip it and get the file named bookfere-tools Folder, copy it to the Kindle root directory extensions folder to complete the installation.
- BookFere Tools Download:Github Download
The specific usage is: enter [BookFere Tools】menu, and then click 【Fix Google Translate】Add IP】 will add a rule containing the available IP address of Google Translate API to the hosts file of Kindle system, and the Google Translate function will automatically return to normal. Click 【Add IP】, if there is a new IP, it will be updated, otherwise it will remain unchanged. Click 【Delete IP】You can delete the rules added to the hosts file.
Method 2: Manually modify the hosts file
This method is more troublesome. You need to install USBNetwork Hack to log in to the Kindle system and run commands, or use the "Terminal" included with KOReader.Simulator"Run command.
First enter the following command and press Enter to get an available Googleserver IP Address:
nslookup google.cn
If the network is normal, you can get information similar to the following, where the last line is the available IP address:
Server: 192.168.1.1 Address 1: 192.168.1.1 Name: google.cn Address 1: 180.163.151.162
Run the following command on the terminal and press Enter to use the system's built-in vi Open the hosts file in the editor.
sudo vi /etc/hosts
Finally, as shown below, combine the IP address 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 Chrome translation function can be restored to normal use.
180.163.151.34 translate.googleapis.com
The specific method of adding is to first use the arrow keys to position the text cursor to the last line, and then press the letter [O】key to enter insert mode and enter (or paste) the above rules. Finally, press 【Esc】key to exit insert mode, enter 😡 to save and exit the vi editor. After the file is saved successfully, the Google Translate function will return to normal.
Method 2: Add API to proxy
If you have a network proxy available, Chrome's Google Translate feature can be used normally in global mode. If you use a proxy switching plug-in in the Chrome web browser, such as SwitchyOmega, you can add the URL rules shown below to the proxy switching rules (for specific rules, refer to the usage provided by the specific plug-in).
*.translate.googleapis.com
Windows users should note that although this method can restore the word-by-word translation function of the plug-in version of Google Translate to normal, it is not applicable to Chrome's built-in web translation function (translating the entire webpage) because its network request is independent and will not pass the rules set by the network proxy plug-in. Therefore, if you want to use Chrome's built-in translation function to translate the entire webpage, 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 above are two ways to restore the normal use of Chrome's Google Translate function. The method of modifying hosts is likely to be time-limited. If one day Google no longer provides a similar shared IP mechanism, or the available IP addresses become fewer and fewer, it may eventually become unusable like Google Search did in the past. In the end, the only method left may be the network proxy.