Translation functions in spreadsheets

Thursday, October 01, 2009 4:20 PM

Earlier this week, we added two functions to Google spreadsheets that add translation and language detection capabilities.
  • =GoogleTranslate("Hola, ¿cómo estás?","es","en") gives "Hi, how are you"
  • =DetectLanguage("Hola, ¿cómo estás?") gives "es"
Breaking down the first function, =GoogleTranslate("field one", "field two," field three"), the first field should be the text you want to translate -- in this case "Hola, ¿cómo estás?". The second field should be the two letter language code of the text you want to translate -- "es" is the two letter code for Spanish. Lastly, the final field indicates which language you want want the text to be translated into -- "en" is the two letter code for English. If you leave out the last field, the function will automatically translate the text into the language of the spreadsheet. The second function, =DetectLanguage("field one") works similarly and outputs the two letter language code of the text.

These functions open up some fun and interesting ways to use forms. For example, you could collect comments in many languages and use the two functions together to automatically translate responses into your native language.


If you hover over a cell with translated text, the original text is displayed.


If you want to try it out for yourself, check out this template. We're excited about the possibilities this opens up and we hope you enjoy translating your spreadsheets.

16 comments:

titus_a said...

Great feature but it would be nice if you could reference a cell with text in it and have it translate. i.e. =GoogleTranslate("A4", "en", "es"). Same with the detect language function.

Bloguero said...

Of course you can, just remove the quotes on "A4"

Mauro Casula said...

Awesome functionality.

Diseño web| TuProgramador.com

Carter said...

this is a great idea for docs, but because I am a student of language, I would like to see a transliteration. Especially for non-latin based langages.

Willem Karssenberg said...

I tried the template but new entries through the form are not translated. How do we take care of that?

Sandro said...

Brilliant!

Sheldon said...

Teachers are going to love these features!!

Geekonweb said...

very useful feature...

Richard van Delft said...

@Willem Karssenberg; just open the spreadsheet, and copy the formula to the new form entries.

Willem Karssenberg said...

@Richard van Delft,
Of course I know, but I would like to have them filled automatically when there is a new entry through the form.
Then you could publish the results on the fly!

ahab said...

@Willem Karssenberg
The GoogleTranslate and DetectLanguage spreadsheet functions are not array expression enabled. This means that when you get submits in English in e.g. column B and want to translate them automatically to Dutch on sumbit, you can not use a formula like =ArrayFormula( GoogleTranslate( B2:B ; "en" ; "nl" ) )

This limitation takes a bit of the shine off these new functions. :(

Also note the DetectLanguage function appears to be flawed, there are already several posts about that in the Google Docs Help forum.

Deborah said...

ok works but learned the hard way that language must be in quotes "ZH" and "EN". I translated 下载销售订单的各种信息 and this 修改SDOC form的Quantity的长度 to "Download sales order all kinds of information" and "Modify the length of SDOC form of the Quantity" using =googletranslate(A1,"ZH","EN") and =googletranslate(A2,"ZH","EN")
A practical application for me as I just started doing a lot of work with China. Thanks!

Anup Surendran said...

I just wanted to let the team know that I am creating a complete site with Google docs and I am pretty sure nobody has done this before. Please check Paper.io and let Sergei and Brin know :)

skyhard said...

It would be really nice of google if you gave us the not in folder view back. I (and many, many other people) need this feature back! Doing anything on Google Docs without this feature takes much longer.

Christian said...

Hey that doesnt work on my Sheets? Why? Is there a limitation for German Users?

Karenj said...

Great feature... I just want to encourage readers to visit http://mls.fastrealestate.net for similar features.