translating complete web page with bing tranlation API

2.6k Views Asked by At

I'm trying to translate complete webpage using Bing API instead of Bing widget , because I want to make custom design for translation panel , but I cant find any way , I registered in Azure market place and got Key , all samples are made for translating a textbox text ... could any one please provide me some help ?

1

There are 1 best solutions below

1
On BEST ANSWER

Found , you must this java script to translate webpage ,

            <script src="http://www.microsoftTranslator.com/ajax/v3/WidgetV3.ashx?siteData=ueOIGRSKkd965FeEGM5JtQ**" type="text/javascript"></script>
       <script type="text/javascript">

                   function translate(co) {
                      if (document.readyState == 'complete') {
                          Microsoft.Translator.Widget.Translate('en', co, onComplete);


                      }
                  }

                  function onComplete() {
                      Microsoft.Translator.Widget.domTranslator.showTooltips = false;
                      Microsoft.Translator.Widget.domTranslator.showHighlight = false;
                      Microsoft.Translator.Widget.domTranslator.showmessagebox = false;
                      Microsoft.Translator.Widget.showTooltips = false;
                  }
                  //You can use Microsoft.Translator.Widget.GetLanguagesForTranslate to map the language code with the language name

Just send language code in any onclick , for example :

        <a href="#" id="a1" style="list-style-image: url('images/flags/ac.png');" lang="en" class="selected">English</a>

hope you can find this useful.