eko / GoogleTranslateBundle

A Symfony bundle to deals with Google Translate API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues Call Google Api Key

atrimech opened this issue · comments

Hi all,
I'm trying to use this service on my application but, i have this problem :

Client error response [url] https://www.googleapis.com/language/translate/v2/detect?key=[key]&q=Hello [status code] 400 [reason phrase] Bad Request

This is my controller :
$translator = $this->get('eko.google_translate.detector');
$translatedString = $translator->detect('Hello');
print_r($translatedString);
die();

And this is my config :
eko_google_translate:
api_key: my_api_key

So i don't know where is the problem exactly, but i thing that it's with my Google Translator Api Key.
Some helps please ?

Hi @medooch,

I've edited your issue to remove your Google Translate API key to avoid someone else to use it...
I think you should change it to avoid any issue.

I don't know why you have this issue actually but I think this is because your key is incorrect?

Hi @eko

Thank you for this quickly reply.

I just want to know if it's required to settings the billing system iCloud to use the key google translator API ?
I've tried to use the same api key but with google Analytics, and all works perfectly !

Hi @medooch,

This should not be the same API key I think.

Here is the procedure to get one: https://cloud.google.com/translate/v2/pricing