Translate Your Web Site Using Bing Translator Widget

Introduction

This article describes how to translate your website using the Bing Translator Widget.

Description

The Translator web page widget allows you to bring real-time, in-place translation to your web site.

You just need to copy and paste some JavaScript code or API to your website.

Open the following link:

http://www.bing.com/widget/translator

Copy the code.

1.jpeg

Or copy the following code that I copied from that link and paste it into your HTML.

  1. <div id='MicrosoftTranslatorWidget' class='Dark' style='color: white; background-color: #555555'>  
  2. </div>  
  3. <script type='text/javascript'>  
  4.                          setTimeout(function () {  
  5. {  
  6.     var s = document.createElement('script');  
  7.     s.type = 'text/javascript'; s.charset = 'UTF-8';  
  8.     s.src = ((location && location.href && location.href.indexOf('https') == 0) ? 'https://ssl.microsofttranslator.com' : 'http://www.microsofttranslator.com') + '/ajax/v3/WidgetV3.ashx?siteData=ueOIGRSKkd965FeEGM5JtQ**&ctf=True&ui=true&settings=Manual&from=en';  
  9.     var p = document.getElementsByTagName('head')[0] || document.documentElement; p.insertBefore(s,  
  10. p.firstChild);  
  11.     }  
  12. }, 0);  
  13. </script> 
Sample to check

Now create a website and a page and add some content to it.

Now design your screen as in the following screen.

2.jpeg

Or you can copy the following source code:
  1. <form id="form1" runat="server">  
  2.     <div>  
  3.         <table>  
  4.             <tr>  
  5.                 <td>  
  6.                     <div id='MicrosoftTranslatorWidget' class='Dark' style='color: white; background-color: #555555'>  
  7.                     </div>  
  8.                     <script type='text/javascript'>  
  9.                             setTimeout(function () {  
  10.     {  
  11.         var s = document.createElement('script');  
  12.         s.type = 'text/javascript'; s.charset = 'UTF-8';  
  13.         s.src = ((location && location.href && location.href.indexOf('https') == 0) ? 'https://ssl.microsofttranslator.com' : 'http://www.microsofttranslator.com') + '/ajax/v3/WidgetV3.ashx?siteData=ueOIGRSKkd965FeEGM5JtQ**&ctf=True&ui=true&settings=Manual&from=en';  
  14.         var p = document.getElementsByTagName('head')[0] || document.documentElement; p.insertBefore(s,  
  15. p.firstChild);  
  16.     }  
  17. }, 0);  
  18.                         </script>  
  19.                 </td>  
  20.             </tr>  
  21.             <tr>  
  22.                 <td style="width: 300px; color:Red; padding-top:10px;">  
  23.                     C# (pronounced see sharp) is a multi-paradigm programming language encompassing  
  24.                     strong typing, imperative, declarative, functional, procedural, generic, object-oriented  
  25.                     (class-based), and component-oriented programming disciplines. It was developed  
  26.                     by Microsoft within its .NET initiative and later approved as a standard by Ecma  
  27.                     (ECMA-334) and ISO (ISO/IEC 23270:2006). C# is one of the programming languages  
  28.                     designed for the Common Language Infrastructure. C# is intended to be a simple,  
  29.                     modern, general-purpose, object-oriented programming language.[6] Its development  
  30.                     team is led by Anders Hejlsberg. The most recent version is C# 5.0, which was released  
  31.                     on August 15, 2012.  
  32.                 </td>  
  33.             </tr>  
  34.         </table>  
  35.     </div>  
  36. </form>
Now build your application.

And click on the "Translate" button.

3.jpeg

It will open a panel with all languages and select the language from the list to translate.

4.jpeg

Here I selected Hindi. So my webpage content will be translated to Hindi.

5.jpeg

Thank you.


Similar Articles