August 7, 2009

English To Hindi / Marathi / Gujarati Translator.

Hi All,

Many of us are facing problem how to translate the English word in Hindi or Marathi or Gujarati, so google provides the solution as,



The Google provides the API and scripts, as follows.


<script src=http://www.google.com/jsapi?key=ABQIAAAA1XbMiDxx_BTCY2_FkPh06RRaGTYH6UMl8mADNa0YKuWNNa8VNxQEerTAUcfkyrr6OwBovxn7TDAH5Q>
</script>

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

function OnLoad()
{

var content = document.getElementById('content');
// Create the HTML for our text area

content.innerHTML = ' <div>Type a word and hit space to get it in Hindi. '
+'Click on a word to see more options.</div>'
+'<textarea id="transliterateTextarea" rows="5" cols="100"></textarea>'
+' <div>Type in (do not copy/paste): '
+'<b>namaste main yahan apke madad karane ke liye hun</b></div>';

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

// Create an instance on TransliterationControl with the required
// options.


var control = new google.elements.transliteration.TransliterationControl (options);

// Enable transliteration in the textbox with id
// 'transliterateTextarea'.

control.makeTransliteratable(['transliterateTextarea']);
}
google.setOnLoadCallback(OnLoad);
</script>

<body style="font-family: Arial;border: 0 none;"> </body>

No comments: