Google translate auto translation doesn’t work
-
Hi,
I tried to Enable the automatic translation of the site with Google Translate, I got the API key from Google console and put it in the plugin settings but nothing happened, I tried with Arabic and with Chinese doesn’t worked, I checked these languages is supported in google here:
https://cloud.google.com/translate/docs/languages#languages-pbmtso what is the problem?
-
Hello Alaa,
It’s possible the API key does not have the correct permissions for your website.
Checkout the documentation page here: https://translatepress.com/docs/translatepress/settings/generate-google-api-key/
In the next version of TranslatePress (should be out today) we’ll have a page where you can check your API key and see what error it throws. This will make it a lot easier to debug. (the link to this page will be next to the API key to the right)
In the mean time, please have a look at the API key permissions, perhaps there was something your overlooked there
There could still be something else that brakes the translation even if the key is correct, however, this is the most common issue we’ve encountered so far.
Hi,
is this feature needs Google Cloud Translation API to be enabled?
If so it isn’t free service from google to use.
Yes. You are correct. Google Cloud Translation API is paid only, however, it’s free for the first year and affordable afterwords.
Also,we’re storing the translation in your database, so you only have to pay once.
OK, thank you..
Could you add this step to your documentation please to don’t let others confuse
Hi,
I enabled Google Cloud Translate API but still not working, I clicked test API link to debug this is the result
Google API Key from settings page: AIzaSyDavn8sXdzrL3cVBvudPwKfY6MeGd7sJuc Response: Array ( [code] => 403 [message] => Forbidden ) Response Body: { "error": { "code": 403, "message": "Requests from referer https://www.googleapis.com/language/translate/v2 are blocked.", "errors": [ { "message": "Requests from referer https://www.googleapis.com/language/translate/v2 are blocked.", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } } Entire Response From wp_remote_get(): Array ( [headers] => Requests_Utility_CaseInsensitiveDictionary Object ( [data:protected] => Array ( [vary] => Array ( [0] => Origin [1] => X-Origin [2] => Referer ) [content-type] => application/json; charset=UTF-8 [content-encoding] => gzip [date] => Tue, 24 Oct 2017 12:42:51 GMT [server] => ESF [cache-control] => private [x-xss-protection] => 1; mode=block [x-frame-options] => SAMEORIGIN [x-content-type-options] => nosniff [alt-svc] => quic=":443"; ma=2592000; v="39,38,37,35" ) ) [body] => { "error": { "code": 403, "message": "Requests from referer https://www.googleapis.com/language/translate/v2 are blocked.", "errors": [ { "message": "Requests from referer https://www.googleapis.com/language/translate/v2 are blocked.", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } } [response] => Array ( [code] => 403 [message] => Forbidden ) [cookies] => Array ( ) [filename] => [http_response] => WP_HTTP_Requests_Response Object ( [response:protected] => Requests_Response Object ( [body] => { "error": { "code": 403, "message": "Requests from referer https://www.googleapis.com/language/translate/v2 are blocked.", "errors": [ { "message": "Requests from referer https://www.googleapis.com/language/translate/v2 are blocked.", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } } [raw] => HTTP/1.1 403 Forbidden Vary: Origin Vary: X-Origin Vary: Referer Content-Type: application/json; charset=UTF-8 Content-Encoding: gzip Date: Tue, 24 Oct 2017 12:42:51 GMT Server: ESF Cache-Control: private X-XSS-Protection: 1; mode=block X-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Alt-Svc: quic=":443"; ma=2592000; v="39,38,37,35" Connection: close Transfer-Encoding: chunked { "error": { "code": 403, "message": "Requests from referer https://www.googleapis.com/language/translate/v2 are blocked.", "errors": [ { "message": "Requests from referer https://www.googleapis.com/language/translate/v2 are blocked.", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } } [headers] => Requests_Response_Headers Object ( [data:protected] => Array ( [vary] => Array ( [0] => Origin [1] => X-Origin [2] => Referer ) [content-type] => Array ( [0] => application/json; charset=UTF-8 ) [content-encoding] => Array ( [0] => gzip ) [date] => Array ( [0] => Tue, 24 Oct 2017 12:42:51 GMT ) [server] => Array ( [0] => ESF ) [cache-control] => Array ( [0] => private ) [x-xss-protection] => Array ( [0] => 1; mode=block ) [x-frame-options] => Array ( [0] => SAMEORIGIN ) [x-content-type-options] => Array ( [0] => nosniff ) [alt-svc] => Array ( [0] => quic=":443"; ma=2592000; v="39,38,37,35" ) ) ) [status_code] => 403 [protocol_version] => 1.1 [success] => [redirects] => 0 [url] => https://www.googleapis.com/language/translate/v2 [history] => Array ( ) [cookies] => Requests_Cookie_Jar Object ( [cookies:protected] => Array ( ) ) ) [filename:protected] => [data] => [headers] => [status] => ) )
Hi,
Your domain looks like it’s blocked by google. Basically your API is not valid for that particular domain.
Please navigate to point 4. Restrict your API Key to a particular website https://translatepress.com/docs/translatepress/settings/generate-google-api-key/ and see if you have it setup correctly.
hello dear
I faced a bug please help me to fix it
I adjusted default language English and second language Arabic then I opened front end page and I changed language to Arabic then I activated translation mode by pressing on translate site button then the translation windows is opened but it is empty without any thing
so please help me to fix this issue
also want to know if it possible to translate the categories from the back end or not ?
thanksYour last post was followed step by step. Still no go. I am still seeing the error as posted by @alaa-rihan.
Not sure if I am missing something here. I even tried with a new API. Domain is validated by Google, site has been added in the dashboard, all looks good.
Question? Is any configuration for the user in the IAM required to be given a Service Management Role?
- The topic ‘Google translate auto translation doesn’t work’ is closed to new replies.