How Translate English text box text to another textbox in hindi using Google Api's [Resolved]

Posted by Pcjoshi under ASP.NET on 1/7/2016 | Points: 10 | Views : 12240 | Status : [Member] | Replies : 3
Hello,

how translate from English to Hindi .
I have two text boxes when i type in first text box in English how to get translate value in another text box .
thanks




Responses

Posted by: Rajnilari2015 on: 1/7/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
@Pcjoshi,
May be your are talking about Google Translator Api . The main point is to set the source and destination language

sourceLanguage:

google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage:
[google.elements.transliteration.LanguageCode.HINDI]


Some links may help you to proceed
http://arunsonare.blogspot.in/2013/04/how-can-translate-english-to-hindi.html
https://rupeshpatel.wordpress.com/2012/06/23/usage-of-google-translator-api-for-free/

Update

Took some help of the first link's code so as to bring a demo-able version as under which we believe will be helpful for your progress

<html>

<head>
<title> Transliteration Help </title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>

<script type="text/javascript">
google.load("elements", "1", {packages: "transliteration"});
</script>

<script>
function OnLoad() {
var currValue = document.getElementById("txtTranslator");

var options = {
sourceLanguage:
google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage:
[google.elements.transliteration.LanguageCode.HINDI],
shortcutKey: 'ctrl+g',
transliterationEnabled: true
};

var control = new
google.elements.transliteration.TransliterationControl(options);
control.makeTransliteratable(["txtTranslator"]);
var postValue = document.getElementById("txtTranslator");
} //end onLoad function

google.setOnLoadCallback(OnLoad);

</script>


</head>
<body>

<input size="40" type="text" id="txtTranslator"/>

</body>
</html>


Hope that helps

--
Thanks & Regards,
RNA Team

Pcjoshi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pcjoshi on: 1/8/2016 [Member] Starter | Points: 25

Up
0
Down
Thank you so much for your quick response .
Actually my problem is that i have two text box one for English another for Hindi, when i type in English on first box how to get Hindi in second box dynamically like google translate . This code is working only one box and translate only when press space key.
thanks

Pcjoshi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajeshatkiit on: 1/8/2016 [Member] Starter | Points: 25

Up
-1
Down
Plz refer this.
http://www.c-sharpcorner.com/forums/convert-from-english-to-hindi-using-c-sharp

Pcjoshi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response