O'Reilly logo

PHP Ajax Cookbook by R. Rajesh Jeba Anbiah, Roshan Bhattarai, Milan Sedliak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Translating text using Google Ajax API

In this section, we will look at the Google Ajax API to translate text from one language to other languages. Google provides Ajax APIs for a large set of operations, like for Google Map, language translation, charts, and so on. In this part, we will look at how to use Google translate Ajax API to translate text from one language to another language.

Getting ready

To use the Google Ajax API, we first need to sign up the key for your particular domain. You can get the API key for Google Ajax API form this URL: http://code.google.com/apis/loader/signup.html. After getting the API key, you can insert the Google API with the following URL:

<script type="text/javascript" src="https://www.google.com/jsapi?key=YOUR-API-KEY"></script> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required