I have a text-box, and I want to enter a string in language A and send it to Google Translate. After Google has translated it, I want to take the new string (in language B) (after translation) and store it in some variable.
How can I do it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The basic idea is shown in a simple example of Language Translation like this:
translationis the id of your textbox. In this case where you put the translation result.resultis 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.