it/itf/static/js/jquery.transliterate.js

27 lines
745 B
JavaScript
Raw Permalink Normal View History

2010-03-03 14:28:00 +00:00
/*
Use like $(elem).GTransliterate(lang);
where lang = a language code like "hi", "ka", etc.
Make sure to include <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> at top of page
Also, you must include this at the top of your page:
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
*/
google.load("elements", "1", {
packages: 'transliteration'
});
jQuery.fn.GTransliterate = function(lang) {
var options = {
sourceLanguage: 'en',
destinationLanguage: [lang],
transliterationEnabled: true
}
var thisId = this.attr('id');
var GControl = new google.elements.transliteration.TransliterationControl(options);
GControl.makeTransliteratable([thisId]);
return this;
}