We tried testing the Google translate feature at the quick translation screen. For this we have added a Google translate API key at the global settings. Afterwards, the button to auto-translate show up at the quick translation screen.
When clicking that button I get "There was an error using the Google API. Detailed error: true.
Since that doesn't tell you much, I enabled debug mode and it turns out that the Ajax request to the API throws a 500m server error. This is the 3.x (latest version) error stack:
<h1>PHP Error [500]</h1>
file_get_contents(https://www.googleapis.com/language/translate/v2?q=%0A%3Cdiv+class%3D%22question-text-from%22%3E%3C%2Fdiv%3E%0A &source=de &target=en &key=XXXXRG4yBSnOF1q22Hw2iazgtjBRr9Hinc &): Failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
(/var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/application/third_party/gtranslate-api/GTranslate.php:272)
#0 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/framework/base/CErrorHandler.php(133): CErrorHandler->handleError()
#1 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/framework/base/CApplication.php(832): CErrorHandler->handle()
#2 unknown(0): LSYii_Application->handleError()
#3 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/application/third_party/gtranslate-api/GTranslate.php(272): file_get_contents()
#4 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/application/third_party/gtranslate-api/GTranslate.php(258): GTranslate->requestHttp()
#5 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/application/third_party/gtranslate-api/GTranslate.php(377): GTranslate->query()
#6 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/application/controllers/admin/translate.php(1021): GTranslate->__call()
#7 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/application/controllers/admin/translate.php(986): translate->translate_google_api()
#8 unknown(0): translate->ajaxtranslategoogleapi()
#9 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/framework/web/actions/CAction.php(115): ReflectionMethod->invokeArgs()
#10 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/application/core/Survey_Common_Action.php(83): translate->runWithParamsInternal()
#11 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/framework/web/CController.php(308): translate->runWithParams()
#12 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/framework/web/CController.php(286): AdminController->runAction()
#13 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/framework/web/CController.php(265): AdminController->runActionWithFilters()
#14 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/application/controllers/AdminController.php(165): AdminController->run()
#15 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/framework/web/CWebApplication.php(282): AdminController->run()
#16 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/framework/web/CWebApplication.php(141): LSYii_Application->runController()
#17 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/framework/base/CApplication.php(185): LSYii_Application->processRequest()
#18 /var/www/vhosts/my-domain.com/httpdocs/ls3dev.my-domain.com/ls/index.php(195): LSYii_Application->run()
We tested the same with the 6.x version and get this error using debug mode:
<h1>PHP Error [500]</h1>
Undefined property: stdClass::$data (/var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/gtranslate-api/GTranslate.php:318)
#0 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/yiisoft/yii/framework/base/CErrorHandler.php(133): CErrorHandler->handleError()
#1 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/yiisoft/yii/framework/base/CApplication.php(832): CErrorHandler->handle()
#2 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/gtranslate-api/GTranslate.php(318): LSYii_Application->handleError()
#3 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/gtranslate-api/GTranslate.php(299): GTranslate->evalResponse()
#4 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/gtranslate-api/GTranslate.php(262): GTranslate->requestCurl()
#5 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/gtranslate-api/GTranslate.php(381): GTranslate->query()
#6 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/application/controllers/QuickTranslationController.php(469): GTranslate->__call()
#7 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/application/controllers/QuickTranslationController.php(428): QuickTranslationController->translateGoogleApi()
#8 unknown(0): QuickTranslationController->actionAjaxtranslategoogleapi()
#9 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/yiisoft/yii/framework/web/actions/CAction.php(114): ReflectionMethod->invokeArgs()
#10 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/yiisoft/yii/framework/web/actions/CInlineAction.php(47): CInlineAction->runWithParamsInternal()
#11 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/yiisoft/yii/framework/web/CController.php(308): CInlineAction->runWithParams()
#12 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/yiisoft/yii/framework/web/CController.php(286): QuickTranslationController->runAction()
#13 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/yiisoft/yii/framework/web/CController.php(265): QuickTranslationController->runActionWithFilters()
#14 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/application/controllers/LSBaseController.php(145): QuickTranslationController->run()
#15 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/yiisoft/yii/framework/web/CWebApplication.php(282): QuickTranslationController->run()
#16 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/yiisoft/yii/framework/web/CWebApplication.php(141): LSYii_Application->runController()
#17 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/vendor/yiisoft/yii/framework/base/CApplication.php(185): LSYii_Application->processRequest()
#18 /var/www/vhosts/my-domain.com/httpdocs/ls6dev.my-domain.com/index.php(161): LSYii_Application->run()
|