The basic idea is shown in a simple example of a language translation as follows:
google.language.translate("Hello world", "en", "es", function(result) {
if(!result.error) {
var container = document.getElementById("translation");
container.innerHTML = result.translation;
}
});
translationis the identifier of your text field. In this case, when you put the translation result.
result- this is the translation itself. You can assign it to a new variable in any way.
"Hello world" "en" () "es" ().
JavaScript.
API Google AJAX Language.