Code for language translation


 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o>
 <HEAD>
  <TITLE>Gujarati translation-Ravishankar</TITLE>
   <script type="text/javascript" src="http://www.google.com/jsapi"></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.GUJARATI,
      shortcutKey: 'ctrl+g',
      transliterationEnabled: true
     };
     var control =
      new google.elements.transliteration.TransliterationControl(options);
     control.makeTransliteratable(['transliterateTextarea']);
      }
      google.setOnLoadCallback(onLoad);   
   </script>
   
 </HEAD>
 <BODY><div class="base"  align="center">
  
  <TABLE class="standard" width="1200">
   <TBODY>
    <TR>
     
     <TD class="mainPanel">
      <TABLE>
       <TBODY>
        <TR>
         <TD vAlign="top" width="800">
          <TABLE cellPadding="5">
           <TBODY>
            <TR>
             <TD>
              
              <form name="convarea" action="" ID="Form1">
               <table ID="Table2">
                <tr>
                 <td align="center">
                  <textarea id="transliterateTextarea" style="width: 550px; height: 220px" name="DraftxData"></textarea>
                 </td>
                </tr>
                <tr>
                 <td style="color: Gray">
                  (Press Ctrl+g to toggle between English and Gujarati)
                 </td>
                </tr>
               </table>
              </form>
              
         
   
 </div></BODY>
</HTML>

Code :
      destinationLanguage:
       google.elements.transliteration.LanguageCode.GUJARATI

you can set any destination language from google API.
 e.g for URDU you can use google.elements.transliteration.LanguageCode.URDU ,for Hindi,google.elements.transliteration.LanguageCode.HINDI,etc

This blog help you to solve all language translation related issues.. Enjoy smart Coding :)
Ebook Download
View all
Learn
View all