Include Google malayalam typing in typing

  • 0

Include below code in header section

=====================================

<script type=”text/javascript” src=”http://www.google.com/jsapi”></script>
<link href=”http://www.google.com/uds/modules/elements/transliteration/api.css” type=”text/css” rel=”stylesheet”/>
<script type=”text/javascript”>
google.load(“elements”, “1”, {packages: “transliteration” });
var transliterationControl;
function onLoad() {
var options = {
sourceLanguage:
google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage:
google.elements.transliteration.LanguageCode.MALAYALAM,
transliterationEnabled: true,
shortcutKey: ‘ctrl+g’
};
transliterationControl =
new google.elements.transliteration.TransliterationControl(options);
var ids = [“cmtx_comment”,”cmtx_name”];
transliterationControl.makeTransliteratable(ids);
transliterationControl.addEventListener(
google.elements.transliteration.TransliterationControl.EventType.STATE_CHANGED,
transliterateStateChangeHandler);
transliterationControl.addEventListener(
google.elements.transliteration.TransliterationControl.EventType.SERVER_UNREACHABLE,
serverUnreachableHandler);
transliterationControl.addEventListener(
google.elements.transliteration.TransliterationControl.EventType.SERVER_REACHABLE,
serverReachableHandler);
document.getElementById(‘checkboxId’).checked =
transliterationControl.isTransliterationEnabled();
}
function transliterateStateChangeHandler(e) {
document.getElementById(‘checkboxId’).checked = e.transliterationEnabled;
}
function checkboxClickHandler() {
transliterationControl.toggleTransliteration();
}
function serverUnreachableHandler(e) {
document.getElementById(“errorDiv”).innerHTML =
“Transliteration server unreachable!”;
}
function serverReachableHandler(e) {
document.getElementById(“errorDiv”).innerHTML = “”;
}
google.setOnLoadCallback(onLoad);
</script>

 

Add Id of text area or text field as cmtx_comment

<textarea name=”cmtx_comment” id=”cmtx_comment”></textarea>

Add a checkbox option to enable Malayalam typing:

<input type=”checkbox” id=”checkboxId” onclick=”javascript: checkboxClickHandler()”><span class=”labels”> &nbsp;Type in Malayalam</span>

 

Reference: Google

Include below code in header section ===================================== <script type=”text/javascript” src=”http://www.google.com/jsapi”></script> <link href=”http://www.google.com/uds/modules/elements/transliteration/api.css” type=”text/css” rel=”stylesheet”/> <script type=”text/javascript”> google.load(“elements”, “1”, {packages: “transliteration” }); var transliterationControl; function onLoad() { var options = { sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH, destinationLanguage: google.elements.transliteration.LanguageCode.MALAYALAM, transliterationEnabled: true, shortcutKey: ‘ctrl+g’ }; transliterationControl = new google.elements.transliteration.TransliterationControl(options); var ids = [“cmtx_comment”,”cmtx_name”]; transliterationControl.makeTransliteratable(ids); transliterationControl.addEventListener( google.elements.transliteration.TransliterationControl.EventType.STATE_CHANGED, transliterateStateChangeHandler); transliterationControl.addEventListener( google.elements.transliteration.TransliterationControl.EventType.SERVER_UNREACHABLE, serverUnreachableHandler); transliterationControl.addEventListener(…

Include below code in header section ===================================== <script type=”text/javascript” src=”http://www.google.com/jsapi”></script> <link href=”http://www.google.com/uds/modules/elements/transliteration/api.css” type=”text/css” rel=”stylesheet”/> <script type=”text/javascript”> google.load(“elements”, “1”, {packages: “transliteration” }); var transliterationControl; function onLoad() { var options = { sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH, destinationLanguage: google.elements.transliteration.LanguageCode.MALAYALAM, transliterationEnabled: true, shortcutKey: ‘ctrl+g’ }; transliterationControl = new google.elements.transliteration.TransliterationControl(options); var ids = [“cmtx_comment”,”cmtx_name”]; transliterationControl.makeTransliteratable(ids); transliterationControl.addEventListener( google.elements.transliteration.TransliterationControl.EventType.STATE_CHANGED, transliterateStateChangeHandler); transliterationControl.addEventListener( google.elements.transliteration.TransliterationControl.EventType.SERVER_UNREACHABLE, serverUnreachableHandler); transliterationControl.addEventListener(…