API

How to transliterate from english to other language using Google Transliterate API?

How to transliterate from english to other language using Google Transliterate API? , someone asked me to explain?

In this article you will learn about Google Transliterate API and how to handle and use it.


Create a html page with name as translitrate.htm and Load the JavaScript API. To begin using the Transliterate API, include the following script in the header of your web page.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="https://www.google.com/jsapi">
</script>
<script type="text/javascript">
// Load the Google Transliterate API
google.load("elements", "1", {
packages: "transliteration"
});

function onLoad() {
var options = {
sourceLanguage:
google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage:
[google.elements.transliteration.LanguageCode.TAMIL],
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

control.makeTransliteratable(['transliterateTextarea']);
}
google.setOnLoadCallback(onLoad);
</script>
</head>
<body>
<span> English to Tamil </span><br>
<textarea id="transliterateTextarea" rows="6" cols="10" style="width:600px;height:100px"></textarea>
</body>
</html>

Post your comments / questions