I’ve built a simple Ajax language translation tool based on the Google Ajax Language API. It’s pretty easy to build one by yourself, by going through some of the examples and documentations given on the Google API page.
Here you go the break down of how I built it.
First, you need to include the few lines, which is the Google Ajax Language API as follows:
Then, within a script tag pair, I call the common loader, to load language API, google.load(“language”, “1″), and I have two functions, which are the translate() function and the showLanguageDropDown() function, which is to translate the text and to show the supported languages when a user clicks on it.
The table that presents the form for user to key the text to be translated, the two drop downs that contain the languages for users to choose for “Translated From” and “Translated To”, and a textarea to show the translated result.
Voila, now you have an ajax translation tool built using Google Ajax Language API. Try out the Ajax Translation Tool here. Improvement: It’ll be better to initialize the drop downs first instead of getting the users to click then only presents the options. You can use the google.setOnLoadCallback(setDropDowns); to set both drop downs in one looping of the language Enum.