The basic idea is shown in a simple example of Language Translation like this:
google.language.translate("Hello world", "en", "es", function(result) {
if(!result.error) {
var container = document.getElementById("translation");
container.innerHTML = result.translation;
}
});
translation
is the id of your textbox. In this case where you put the translation result.
result
is the translation itself. You can assign it to a new variable in any way you want.
In the above example you're translating "Hello world" from "en" (English) to "es" (Spanish).
The above code is written in JavaScript.
Take a look at Google AJAX Language API for more detailed steps.