Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto translation with GOOGLETRANSLATE is not working [duplicate]

The issue is simple, when I try to do auto translate from English to a detected language I got an error, the formula is:

=GOOGLETRANSLATE("Cat"; "en"; "auto")

and the error is something like

Error, Google Translate does not support translation from en to pl-PL.

The problem (I think) is that GOOGLETRANSLATE is supposed to get language as two letter code when default value is language + country code (which is not supported https://support.google.com/docs/answer/3093331?hl=en)

Is it possible to fix that? I would like to translate to user's language (so I want to use "auto" value), no matter what is the language and I assume that if the problem occurs for one language it will happen for different one.

like image 491
outlying Avatar asked Sep 13 '25 09:09

outlying


2 Answers

Have you tried to use ; instead of ,.

Example:

=GOOGLETRANSLATE(A1 ; "auto"; "bg")
like image 83
Tanyo Ivanov Avatar answered Sep 16 '25 18:09

Tanyo Ivanov


I have the same issue for Russian. The formula =GOOGLETRANSLATE("Cat"; "en"; "auto") gives the error:

Google Translate does not support translating from en to ru-RU.

This is Google issue, the best way is to report it:

  • Menu: Help > Report a problem

Here's a workaround:

  • make a script to detect sheet's locale.
  • use regex to extract first part of a locale string.

Here's the sample code:

function getLocale()
{
  var locale = SpreadsheetApp.getActive().getSpreadsheetLocale(); // pl_PL    
  return /(.*)_/.exec(locale)[1]; // pl
}

The usage:

=GOOGLETRANSLATE("Cat"; "en"; getLocale())

like image 44
Max Makhrov Avatar answered Sep 16 '25 19:09

Max Makhrov