Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Use Google Input Tools in Website

Can you please let me know if it is possible to use Google Input Tools in a website using client side scripting like jquery or pure javascript? Is there any API available for Google Input Tools?

I already google this but couldn't find any thing?

Thanks

like image 769
Suffii Avatar asked Feb 24 '15 22:02

Suffii


People also ask

How do I enable Google Input?

To enable Input Tools in Gmail, follow these steps: Click the gear icon in the upper right, then select “Settings”. In the General tab, select the check box next to “Enable input tools” under the “Language” section.

Is Google Input Tools Free?

Google Input Tools is a free software extension that lets users enter text in another language when you cannot type the correct characters from your computer keyboard.


1 Answers

If you want to add google input tools you can use below code to add it

    
      // Load the Google Transliteration API
      google.load("elements", "1", {
        packages: "transliteration"
      });
    
      function onLoad() {
        var options = {
          sourceLanguage: 'en',
          destinationLanguage: ['gu', 'ml', 'hi', 'kn', 'ta', 'te'],
          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 src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
  
<textarea name="hi"  rows="6"  id="language" cols="6" style="width:600px;height:70px" ></textarea>

<div id='translControl'></div>
like image 121
Parvathy Nair Avatar answered Sep 27 '22 23:09

Parvathy Nair