An unofficial blog that watches Google's attempts to move your operating system online since 2005. Not affiliated with Google.

Send your tips to gostips@gmail.com.

March 20, 2008

Google Translate API

Google launched another AJAX API, this time for language detection and translation. The API works for the same language pairs that are available at Google Translate and lets you display the translation of a text inside your own page, without having to link to an external translation service.

The translation API could be used to automatically translate some content from a web page using the browser's preferred language, to create a Greasemonkey script that translates to English the posts written in other languages, to detect if a comment is written in English before posting it and for many other things.

Here's one example of use, where you can enter a text in one of the supported languages (Arabic, Chinese, French, German, Greek, Dutch, Italian, Japanese, Korean, Portuguese, Russian, Spanish), Google automatically detects the language and it shows the English translation. The sample text is from Le Monde.






36 comments:

  1. You mean like:

    http://www.steeleweed.com/computer.html

    ReplyDelete
  2. translation didn't work for me:(

    ReplyDelete
  3. @Anonymous:
    I changed the sample text because Google returned an error message: "the string to be translated exceeds the maximum length allowed".

    ReplyDelete
  4. Apparently, there is a restriction on how long text strings can be -- it's 500 characters.

    ReplyDelete
  5. http://code.google.com/p/jquery-translate/
    No limits with this!

    ReplyDelete
  6. thanks for the information, i used google translate, it was a great tools.

    ReplyDelete
  7. Can you use this API in any web based application?

    ReplyDelete
  8. The Google translations are excellent. Try comparing to Yahoo! which uses the SysTran product. SysTran really needs to get out of the machine-driven translation business, because they cannot translate something as simple or as common as "c'est" or "l'un de" or anything with an apostrophe. If you get past the failure to handle simple apostrophes, the rest truly a joke. It's as if they found the worst programmers in the world and paired them up with functionally illiterate linguists. How in God's name does a company whose reason for being is translation botch things so badly? They're an embarrassment.

    ReplyDelete
  9. I have developed Online Translation Service http://translator.vndv.com/ page which uses Google AJAX Language API. I also used Google AJAX Language API to translate the user interface of Online Translation Service to the following languages: English, Arabic, Bulgarian, Chinese, Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hindi, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Romanian, Russian, Spanish, Swedish.

    ReplyDelete
  10. Yes I am need to connection and get data code. FOr example php code. This is AJAX and search engine doesn't reading in it.

    ReplyDelete
  11. Need an API for Indian languages in which google home page can be viewed, like Bengali,Telugu,Marathi,Tamil,Gujarati,Kannada,Malayalam,Punjabi. Please help.

    ReplyDelete
  12. I am searching for a custom implementation of google translation, google cache or any other service of google to achieve results similar to that of an anonymous proxy server.

    ReplyDelete
  13. The translation API could be used to automatically translate some content from a web page using the browser's preferred language, to create a Greasemonkey script that translates to English the posts written in other languages, to detect if a comment is written in English before posting it and for many other things.

    ReplyDelete
  14. How can we use this with PHP ?

    ReplyDelete
  15. Thanks Phil for mentioning the jquery translate plugin.

    ReplyDelete
  16. Yet another good free service from Google.
    I wish I could use API with SOAP, so developer like me can develop grate translating applications.

    ReplyDelete
  17. Yet another good free service from Google.
    I wish Google develop API with SOAP, so that many kinds of translating applications can be developed.

    ReplyDelete
  18. Nice toolset, but i have one problem (i know it's caused by google, but still) How many of you tried to translate from english to german, and then to french.

    ReplyDelete
  19. You should never ever use as an input machine translation. It's a very bad idea because the translation is likely that include many mistakes. Translate from English directly to French.

    ReplyDelete
  20. Its a cool stuff though but i when i translate from english to french, i always get &#39 instead of an ', i dont know what the problem is pls help.

    ReplyDelete
  21. PHP / SOAP please!!! :-)))

    ReplyDelete
  22. google api and the translation really great thanks

    ReplyDelete
  23. can you people provide a API for multiple texts in Ajax. Means Request contains array of texts and response containd priticular language translated array texts.

    ReplyDelete
  24. will this work if i need to develop an iphone app? And can the iphone app then work in a place where there is no 3G or wireless internet coverage?

    ReplyDelete
  25. I love it. I used this on my website www.reactiq.com. Depending on the browser language, I automatically translate all the text to the browser language. It's weird because when I go to my own website, I can do so using any language - not understanding it at all!

    ReplyDelete
  26. PHP API is available here:

    http://www.codediesel.com/php/google-translation-php-wrapper/

    ReplyDelete
  27. Google translate may be one of the best translation tools on the web but it's still very poor and should not be relied upon for an accurate translation. If you don't speak the second language you want to translate to it's too easy to be impressed with the results but to a native speaker the results are often comical. If you're a student studying a second language don't even think about using a translation tool to hand in work as your own. It will be all too obvious that it's not. One day these tools will provide excellent translations but there's a way to go yet.

    ReplyDelete
  28. hello,
    i many number of documents(about 10000) to convert into English. do i have to copy my text from every document and paste it and note the translated text.
    Can anyone suggest me how to do this.. an eaiser way??

    ReplyDelete
  29. And now it's gone. :(
    http://googlecode.blogspot.com/2011/05/spring-cleaning-for-some-of-our-apis.html

    ReplyDelete
  30. Guys, use this Web method for GOOGLE TRASLATOR.

    [WebMethod]
    public XmlDocument LanaguageTransformation(string language)
    {
    Uri uri = new Uri("https://www.googleapis.com/language/translate/v2?key=AIzaSyAASWPPmEze624Rw5DtAFHHNWA2M4en8eM&q=" + language + "&source=en&target=fr&callback=handleResponse&prettyprint=true&format=text");
    HttpWebRequest requst = HttpWebRequest.Create(uri) as HttpWebRequest;
    requst.Method = WebRequestMethods.Http.Get;
    HttpWebResponse response = requst.GetResponse() as HttpWebResponse;
    StreamReader reader = new StreamReader(response.GetResponseStream());

    string tmp = reader.ReadToEnd();
    StringBuilder strtemp = new StringBuilder();
    string[] str = tmp.Split('"');
    strtemp.Append("");
    strtemp.Append("");
    strtemp.Append("" + str[7] + "");
    strtemp.Append("");
    XmlDocument xdoc = new XmlDocument();
    xdoc.LoadXml(strtemp.ToString());
    return xdoc;
    }

    ReplyDelete
  31. hi guys.. plz tell me the php code to use Google Translator API...in my php application to convert the hindi language into english and detects the source language too...thanx..!!

    ReplyDelete
  32. You'll get an error if you try to translate text.
    Error: Please use Translate v2. See http://code.google.com/apis/language/translate/overview.html

    ReplyDelete