0

Is it possible to set google chrome desktop (latest) to always translate the content on a certain site.

At the moment for each page on the same website i browse to i need to click the translate widget in the top nav and select translate page.

3
  • You can set a language to be automatically translated in Settings > Advanced > Language, option "Offer to translate pages in this language". Is that a solution?
    – harrymc
    Commented Jul 29, 2019 at 16:15
  • @harrymc , thanks harry, re. "is that a solution" kind of, i was hoping to be able to set it for this one site only rather than the whole language, but this might suffice.
    – sam
    Commented Jul 29, 2019 at 18:42
  • Actually you already have that, so this needs a better solution.
    – harrymc
    Commented Jul 30, 2019 at 15:50

3 Answers 3

1

Use a Chrome Extension like Requestly to redirect only certain pages to a translation service.

This example translates all pages of computerbase.de from German to English. Requestly conditional page translation

This is just one way to do it! There are many other tools that can do something similar; not only redirecting requests, but e.g. forwarding search queries to custom search engines.

2
0

This is not a standard option in Chrome, and I have not found any extension that does this, so it's "write my own".

The tool I'll use is AutoHotkey, and I'll make several the assumption that Chrome is always started with the same window size and position, meaning that the Translate prompt will always appear on the same spot.

The AutoHotkey script below will:

  1. Set up a timer that will every 0.5 seconds check a known rectangle on the screen for containing a given color color, like the red rectangle below:

    enter image description here

  2. Once found, the script will first save the clipboard contents, then position to the address bar using Alt+D, and copy the URL to the clipboard, retrieve the clipboard contents, and finally return the previous contents of the clipboard.

  3. It will check if the URL starts with a given string, and if so click the "Translate" button, wait a bit, then click the x-button of the "Translated" dialog to close it.

The parameters in the script are the ones I have used and which you will need to modify:

  • The website in question is specified in the variable Site
  • The PixelSearch specifying the rectangle to be searched, top-left and right-bottom pixels, and the color to check (if different). (The best way to find pixel coordinates is to take a screenshot of the full screen and use an image editor.)
  • The coordinates of the "Translate" button in the first Click command
  • The coordinates of the closing x-button of the "Translated" dialog in the second Click command.

You may set the script to start with Windows by putting a link to it in the Startup group, or start it manually by double-click when required. It will create a green H icon in the traybar, which you may use to stop it by right-click and "Exit".

The script itself is to be stored in an .ahk file:

#Persistent
CoordMode Pixel, Screen 
CoordMode Mouse, Screen 

Site = https://world.taoba
Length := StrLen(Site)
SetTimer, PixelCheck, 500, On
return

PixelCheck:
{
    SetTimer, PixelCheck, Off
    PixelSearch, X, Y, 2530, 220, 2545, 240, 0x4986EA , 10, RGB
    if (ErrorLevel = 0) {
        ChromeURL := GetChromeURL()
        Prefix := SubStr(ChromeURL, 1 , Length)
        if (Prefix = Site) {
            Click, 2600, 235
            sleep, 500
            Click, 2813, 136
        }
    }
    SetTimer, PixelCheck, 500, On
    Return
}

GetChromeURL()
{
    WinGetClass, ActWinClass, A
    if (ActWinClass = "Chrome_WidgetWin_1")
    {
        tempclip1:=clipboard
        sleep,12
        blockinput, on

        send, !{d}
        sleep,12
        send, ^{c}
        sleep,12
        tempclip2:=clipboard
        sleep,12
        clipboard:=tempclip1
        sleep,12
        blockinput, off
        return tempclip2
    } else
        return ""
}

I have tested this script and it worked for me. If it doesn't work for you, check the entered parameters.

0
0

Google translate has an option to translate a web page, and if you do it this way, clicking on links within the translated page will cause it to translate after the jump.

For example, this brings up the Amazon Japan site in English:

https://translate.google.com/translate?sl=ja&tl=en&u=http%3A%2F%2Fwww.amazon.co.jp

It puts the Google Translate widget at the top of the page, and further navigation uses whatever settings that has so long as the View remains as Translation:

Amazon Japan Web-page translated to English

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .