Click here to Skip to main content
15,889,992 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How do i use google API english to hindi convert i have type one text box and get transliterate text in another text box.
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="http://api.jquery.com/scripts/events.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("language", "1");

</script>
</head>
<body>
<form id="form1" runat="server">


<asp:TextBox ID="target" runat="server">




<asp:TextBox ID="transliteration" runat="server">


</form>



<script type="text/javascript">

$("#target").keyup(function (event) {

var str = $("#target").val().toString();
var a = str.split(' ');

google.language.transliterate(a, "en", "hi", function (result) {
var container = document.getElementById("transliteration");

var data = "";
for (var i = 0; i < result.transliterations.length; i++) {
data = data + " " + result.transliterations[i].transliteratedWords[0];
}
container.innerText = data;;
});

});
</script>
</body>
</html>
Posted
Comments
Krunal Rohit 17-Sep-15 2:19am    
And you stuck at ?

-KR
Sinisa Hajnal 17-Sep-15 3:23am    
What is the problem here? Do you get some error? You have to provide more details if you have some problem, we cannot divine what happens on your side. You have to describe what you need. Use Improve question link

Thank you.

1 solution

Check out this Google Transliterate example - https://developers.google.com/transliterate/v1/getting_started?hl=en[^].
 
Share this answer
 
Comments
Member 11675009 17-Sep-15 3:25am    
I already check out this Google Transliterate example.Google Transliterate service is already working but i want type english word in a text box and transliterate value get another textbox.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900