Wrong Google translation with APIs - correct translation from google search pages

210 views
Skip to first unread message

Federico Bari

unread,
Apr 15, 2021, 11:54:10 AM4/15/21
to Google Cloud Translation API
I need to translate a list of medicine active ingredients. Using the API I get wrong translations from time to time; for the very same active ingredients for which I get an erroneous translation, I have the right translation from the Google search web page. Here is an example for the active ingredient "CALCIO LATTOGLUCONATO" in Italian original language

Here is the code for the API setting in PHP (but could be done in any other language)

function translateText($text, $source_language, $translation_language){ 

     //$post_array = $this->input->post(); 
     $params= array( "q" => $text, 
                              "target" => $translation_language, 
                              "format" => 'text', "source" => $source_language, 
                              "model" => 'base', 
                              "key" => // here my personal key ); 
                             

      return postCURL($url, $params); 
 }

I think it is worth underlining that this is not a coding bug/issue, it is an issue referred to the Google Translate API. Could change something using a different model instead of the "base" one?

Thanks.

Here is the screenshot of the correct result from the Google web search page translator:


Cattura.GIF

Adam Bittlingmayer

unread,
Apr 15, 2021, 12:04:44 PM4/15/21
to Google Cloud Translation API
Yeah, they're not guaranteed to use the same models, nor even to be deterministic.

Efim (Cloud Platform Support)

unread,
Apr 16, 2021, 5:45:04 PM4/16/21
to Google Cloud Translation API
Please provide the following information.
1. Full API request and response without any personal, or sensitive information.
2. What is the coding language?

Jovi Juan

unread,
May 13, 2021, 7:30:14 AM5/13/21
to Google Cloud Translation API
Sorry to jump in here, but I am having a similar problem. I'd like to note this is a common, yearslong complaint/issue in sheets via the =googletranslate() function.

I was hoping to get around the problem by directly accessing the api via python, but that seems to be a waste of time, given the above note.

It seems like this is the intended behaviour (at least in sheets)? Can someone confirm that? I got that info from the community discussion board.

Is it possible to access the good api that powers translate.google.com?

Thanks for your help. 
Screenshot 2021-05-11 at 21.11.35.png
Screenshot 2021-05-11 at 21.12.33.png
Screenshot 2021-05-11 at 21.11.56.png

Jun (Cloud Platform Support)

unread,
May 17, 2021, 6:52:07 PM5/17/21
to Google Cloud Translation API
Hi,

It looks that you'll need to reach out to the Google Docs Editors Help Community [1] for your issue regarding the GOOGLETRANSLATE(text, [source_language, target_language]) [2] at Google Sheet, as this google group is for general discussions about Cloud Translation API [3]. 

Reply all
Reply to author
Forward
0 new messages