Click here to Skip to main content
13,198,325 members (85,573 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
How to Integrate Google Translator with ASP.NET using C# to convert English to Kannada
Posted 30-Dec-12 20:18pm
Updated 17-Jan-17 19:15pm
Comments
aniket_Patil 26-Mar-13 0:47am
   
but where we display translated text.???
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Here is the example code to convert the entered text to kannada while typing(transliteration):

Suppose you have a textbox "txtDetails" on your aspx page.

<script type="text/javascript" src="https://www.google.com/jsapi">
    </script>
    <script type="text/javascript">
 
        // Load the Google Transliterate API
        google.load("elements", "1", {
            packages: "transliteration"
        });
 
        function onLoad() {
            var options = {
                sourceLanguage:
                google.elements.transliteration.LanguageCode.ENGLISH,
                destinationLanguage:
                google.elements.transliteration.LanguageCode.KANNADA,
                shortcutKey: 'ctrl+g',
                transliterationEnabled: true
            };
 
            // Create an instance on TransliterationControl with the required
            // options.
            var control =
            new google.elements.transliteration.TransliterationControl(options);
 
            // Enable transliteration in the textbox with id
            // 'transliterateTextarea'.
            control.makeTransliteratable(['txtDetails']);
        }
        google.setOnLoadCallback(onLoad);
    </script>


For translation see:
http://weblogs.asp.net/jalpeshpvadgama/archive/2010/05/18/google-translation-api-integration-in-net.aspx[^]
  Permalink  
Comments
Ocean007 26-Jun-13 11:14am
   
gud code worked for me thnx ;)
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Hi,
 
It's simple to play with a translator, but first you have to register on google account and need to take token or ID to access the API using this you have to pass required value and test language and language code to be convert. 
 
It's like that: new google.translate.TranslateElement({ pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE }, 'google_translate_element')
 
Please check on google API they also guide for the same with etch steps.
 
Thanks,
AP
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

It's simple to play with a translator, but first you have to register on google account and need to take token or ID to access the API using this you have to pass required value and test language and language code to be convert. 
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web01 | 2.8.171020.1 | Last Updated 18 Jan 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100