Showing posts with label language. Show all posts
Showing posts with label language. Show all posts

Thursday, 25 September 2014

Google Translator plugin for Browsers in Js

<script type="text/javascript">function googleTranslateElementInit() {
  var elem = new google.translate.TranslateElement({
    pageLanguage: "ca", 
    layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL,
    autoDisplay: false,
    floatPosition: 0
  });
  elem.onTurnOffLanguageClick = function() {
    var event = document.createEvent("Event");
    event.initEvent("translateExt_disable_lang", true, true);
    document.body.dispatchEvent(event);
  };
  var style = document.createElement("style");
  style.appendChild( document.createTextNode( ".global_header { top: 40px !important; }" ) );
  document.getElementsByTagName( "head" )[ 0 ].appendChild( style );
  elem.showBanner(false);
}</script>

Thursday, 11 September 2014

Regional Language in Google Transliteration API

<script src="https://www.google.com/jsapi" type="text/javascript">
</script>
<script type="text/javascript">
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
};
var control = new google.elements.transliteration.TransliterationControl(options);
control.makeTransliteratable(['transliterateTextarea']);
}
google.setOnLoadCallback(onLoad);
</script>
<div class="Google-transliterate-Way2blogging">
Type in Hindi (Press Ctrl+g to toggle between English and Tamil)<br>
<textarea id="transliterateTextarea" style="width:600px;height:200px;resize:none;">
</textarea>
<span style="font-weight:bold;font-size:10px;float:right;margin:5px;">
</span>
</div>