View Issue Details

This bug affects 1 person(s).
IDProjectCategoryView StatusLast Update
19441Bug reportsTranslationpublic2024-02-26 09:13
ReporterMazi Assigned Toc_schmitz  
Status feedbackResolutionopen 
Product Version6.4.x 
Summary19441: Google translate feature broken at 3.x and 6.x (and probably 5.x?)

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>
<p>file_get_contents( &source=de &target=en &key=XXXXRG4yBSnOF1q22Hw2iazgtjBRr9Hinc &): Failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
<pre>#0 /var/www/vhosts/ CErrorHandler->handleError()
#1 /var/www/vhosts/ CErrorHandler->handle()
#2 unknown(0): LSYii_Application->handleError()
#3 /var/www/vhosts/ file_get_contents()
#4 /var/www/vhosts/ GTranslate->requestHttp()
#5 /var/www/vhosts/ GTranslate->query()
#6 /var/www/vhosts/ GTranslate->__call()
#7 /var/www/vhosts/ translate->translate_google_api()
#8 unknown(0): translate->ajaxtranslategoogleapi()
#9 /var/www/vhosts/ ReflectionMethod->invokeArgs()
#10 /var/www/vhosts/ translate->runWithParamsInternal()
#11 /var/www/vhosts/ translate->runWithParams()
#12 /var/www/vhosts/ AdminController->runAction()
#13 /var/www/vhosts/ AdminController->runActionWithFilters()
#14 /var/www/vhosts/ AdminController->run()
#15 /var/www/vhosts/ AdminController->run()
#16 /var/www/vhosts/ LSYii_Application->runController()
#17 /var/www/vhosts/ LSYii_Application->processRequest()
#18 /var/www/vhosts/ LSYii_Application->run()

We tested the same with the 6.x version and get this error using debug mode:
<h1>PHP Error [500]</h1>
<p>Undefined property: stdClass::$data (/var/www/vhosts/</p>
<pre>#0 /var/www/vhosts/ CErrorHandler->handleError()
#1 /var/www/vhosts/ CErrorHandler->handle()
#2 /var/www/vhosts/ LSYii_Application->handleError()
#3 /var/www/vhosts/ GTranslate->evalResponse()
#4 /var/www/vhosts/ GTranslate->requestCurl()
#5 /var/www/vhosts/ GTranslate->query()
#6 /var/www/vhosts/ GTranslate->__call()
#7 /var/www/vhosts/ QuickTranslationController->translateGoogleApi()
#8 unknown(0): QuickTranslationController->actionAjaxtranslategoogleapi()
#9 /var/www/vhosts/ ReflectionMethod->invokeArgs()
#10 /var/www/vhosts/ CInlineAction->runWithParamsInternal()
#11 /var/www/vhosts/ CInlineAction->runWithParams()
#12 /var/www/vhosts/ QuickTranslationController->runAction()
#13 /var/www/vhosts/ QuickTranslationController->runActionWithFilters()
#14 /var/www/vhosts/ QuickTranslationController->run()
#15 /var/www/vhosts/ QuickTranslationController->run()
#16 /var/www/vhosts/ LSYii_Application->runController()
#17 /var/www/vhosts/ LSYii_Application->processRequest()
#18 /var/www/vhosts/ LSYii_Application->run()

Steps To Reproduce

Steps to reproduce

Enter a valid Google translate API key. Use quick translation to translate details at a multilingual survey and click "Auto Translate" there.

Expected result

Texts should get translated

Actual result

Error, see above

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)6.4.5
I will donate to the project if issue is resolvedNo
Database type & versionMariaDB 10.1.48
Server OS (if known)
Webserver software & version (if known)
PHP Version8.2

Users monitoring this issue

There are no users monitoring this issue.




2024-02-23 21:23

updater   ~79616

@DenisChenu, do you have an API key at hand to test if you can reproduce this?



2024-02-24 09:39

administrator   ~79617

Update to the latest version. There has been a recent fix.



2024-02-26 09:07

updater   ~79618

@c_schmitz, thanks a lot for the hint. I updated to 6.4.8+240221 but still get error "There was an error using the Google API. Detailed error: true." when clicking the auto translate button.



2024-02-26 09:08

administrator   ~79619

Check your Google API console if you can see any errors/calls there.

Issue History

Date Modified Username Field Change
2024-02-23 21:22 Mazi New Issue
2024-02-23 21:23 Mazi Note Added: 79616
2024-02-23 21:23 Mazi Bug heat 0 => 2
2024-02-24 09:39 c_schmitz Assigned To => c_schmitz
2024-02-24 09:39 c_schmitz Status new => feedback
2024-02-24 09:39 c_schmitz Note Added: 79617
2024-02-24 09:39 c_schmitz Bug heat 2 => 4
2024-02-26 09:07 Mazi Note Added: 79618
2024-02-26 09:07 Mazi Status feedback => assigned
2024-02-26 09:08 c_schmitz Note Added: 79619
2024-02-26 09:13 c_schmitz Status assigned => feedback