I am trying to run different web page translations in Google Chrome and edge.
This is the option I would want to use for all languages to English. I have tried the below code but it wouldn't force any translation.
options = Options()
prefs = {
"translate_whitelists": {"es": "en"},
"translate_whitelists": {"de": "en"},
"translate_whitelists": {"ja": "en"},
"translate_whitelists": {"ar": "en"},
"translate_whitelists": {"zh": "en"},
"translate_whitelists": {"hi": "en"},
"translate": {"enabled": "true"}
}
options.add_experimental_option( "prefs", prefs )
options.add_argument( "--lang=en" )
driver = Chrome( executable_path='/usr/local/bin/chromedriver', chrome_options=options )
I am still not able to get the page translation working. The translation widget appears but doesn't tranlsate anything. It is able to detect language as well.
I have already tried these solutions.
Automatic translation is disabled when using selenium in chrome