@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