• Resolved sunpress

    (@sunpress)


    I got an API key from Google to use with TranslatePress.
    When I configure Automatic Translation to use with Google Translate v2, I get an error:
    “There was an error with your Google Translate key”
    The API key was created successfully in my Google platform, all seems to be ok.
    Anyone can help identify the problem please?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    ?Be sure you don’t have any error in the API response. You can test the key using the Test button from TP Settings –> Automatic Translation.

    Cheers,

    Thread Starter sunpress

    (@sunpress)

    Hi Denis,
    Thank you for your reply.
    When I run the test, I get the error below:
    Any thoughts?

    Response:
                    Array
    (
        [code] => 403
        [message] => Forbidden
    )
    Response Body:
                    {
      "error": {
        "code": 403,
        "message": "Cloud Translation API has not been used in project 236099077847 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/translate.googleapis.com/overview?project=236099077847 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
        "errors": [
          {
            "message": "Cloud Translation API has not been used in project 236099077847 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/translate.googleapis.com/overview?project=236099077847 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
            "domain": "usageLimits",
            "reason": "accessNotConfigured",
            "extendedHelp": "https://console.developers.google.com"
          }
        ],
        "status": "PERMISSION_DENIED",
        "details": [
          {
            "@type": "type.googleapis.com/google.rpc.Help",
            "links": [
              {
                "description": "Google developers console API activation",
                "url": "https://console.developers.google.com/apis/api/translate.googleapis.com/overview?project=236099077847"
              }
            ]
          },
          {
            "@type": "type.googleapis.com/google.rpc.ErrorInfo",
            "reason": "SERVICE_DISABLED",
            "domain": "googleapis.com",
            "metadata": {
              "consumer": "projects/236099077847",
              "service": "translate.googleapis.com"
            }
          }
        ]
      }
    }

    I have the same problem

    me too, has this been solved?

    Aims

    (@amyaturnerwp)

    Same. Seems like a newly introduced bug in the TranslatePress plugin. Maybe Google changed something and TranslatePress needs to adjust its integration ?

    • This reply was modified 1 year, 12 months ago by Aims.

    me too, has this been solved?

    Aims

    (@amyaturnerwp)

    Hi all,

    I got mine resolved finally, so I hope this helps you if your problem is the same or similar:

    Permission was restricted in the Google API dashboard for my Google Translate API app.

    You should be able to edit the API key’s restrictions – access your https://console.cloud.google.com and either change the restrictions None or No Application Restrictions and Don’t Restrict key. Or if you’re concerned about others possibly accessing and using your API key, you can set to restrict by HTTP Referrers (web sites).

    I did not want to leave the app unrestricted, so I added my domain to the HTTP referrer list. However, it did not work when I entered only mysite.org/* –– I had to enter https://www.mysite.org/* for it to work (I added both). Yours may be https://yoursite.com without the ‘www’ part (maybe add a few versions and retest).

    I also had to set up OAuth for my Google app. I couldn’t use the “Internal” user type, so I set up the External user type, added myself as a test user, and then didn’t submit the app, but this worked in the end.

    So hopefully those tips help if you are having the same problem with the Google Translate API key 403 error.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Google Translate key (API error)’ is closed to new replies.