forzac / google-api-php-client

Automatically exported from code.google.com/p/google-api-php-client
Apache License 2.0
0 stars 0 forks source link

google-translate-language #363

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.download
2./var/www/
3.localhost/googleAPI/examples/translate/simple.php

What is the expected output? What do you see instead?

PHP Fatal error:  Uncaught exception 'Google_ServiceException' with message 
'Error calling GET 
https://www.googleapis.com/language/translate/v2/languages?key=the appkey: 
(404) Not Found' in /var/www/googleAPI/src/io/Google_REST.php:66
Stack trace:
#0 /var/www/googleAPI/src/io/Google_REST.php(36): 
Google_REST::decodeHttpResponse(Object(Google_HttpRequest))
#1 /var/www/googleAPI/src/service/Google_ServiceResource.php(183): 
Google_REST::execute(Object(Google_HttpRequest))
#2 /var/www/googleAPI/src/contrib/Google_TranslateService.php(67): 
Google_ServiceResource->__call('list', Array)
#3 /var/www/googleAPI/examples/translate/simple.php(13): 
Google_LanguagesServiceResource->listLanguages()
#4 {main}
  thrown in /var/www/googleAPI/src/io/Google_REST.php on line 66

What version of the product are you using? On what operating system?
 google-api-php-client-0.6.5,ubuntu 12.04

Please provide any additional information below.

Original issue reported on code.google.com by sunshion...@gmail.com on 6 Aug 2013 at 8:18

GoogleCodeExporter commented 9 years ago
Have you enabled the API for the developer key? That call works fine for here. 

Original comment by ianbar...@google.com on 6 Aug 2013 at 1:55

GoogleCodeExporter commented 9 years ago
when i use the command : curl
curl https://www.googleapis.com/language/translate/v2?key=my 
appkey&source=en&target=zh_CN&q=Hello%20world

like above, but the error like below:
{"error":{"errors":[{"domain":"global","reason":"notFound","message":"Not 
Found"}],"code":404,"message":"Not Found"}}

Original comment by sunshion...@gmail.com on 7 Aug 2013 at 7:52

GoogleCodeExporter commented 9 years ago
Hmm, try zh-CN rather than zh_CN

Original comment by ianbar...@google.com on 7 Aug 2013 at 3:26