Skip to content

Instantly share code, notes, and snippets.

@mahedi2014
Created June 9, 2016 08:18
Show Gist options
  • Save mahedi2014/3bb0579405d349bec4142303a83bc730 to your computer and use it in GitHub Desktop.
Save mahedi2014/3bb0579405d349bec4142303a83bc730 to your computer and use it in GitHub Desktop.
Virtual bangla input in textarea for web
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi">
</script>
<script type="text/javascript">
// Load the Google Transliteration API
google.load("elements", "1", { packages: "transliteration" });
function onLoad() {
var options = {
sourceLanguage: 'en',
destinationLanguage: ['bn'],
shortcutKey: 'ctrl+m',
transliterationEnabled: true
};
// Create an instance on TransliterationControl with the required
// options.
var control = new google.elements.transliteration.TransliterationControl(options);
// Enable transliteration in the textfields with the given ids.
var ids = [ "language" ];
control.makeTransliteratable(ids);
// Show the transliteration control which can be used to toggle between
// English and Hindi and also choose other destination language.
control.showControl('translControl');
}
google.setOnLoadCallback(onLoad);
</script>
</head>
<body>
<form><textarea name="ta" rows="6" id="language" cols="6" style="width:600px;height:218px" ></textarea></form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment