Thứ Bảy, 3 tháng 5, 2014

Bing Translator for Blog/ Website

0 nhận xét


Microsoft Translator for Blogs/ Websites




Search engine Bing has a nice translator widget for your blog or website. With this translator, your reader can translate the site in their own languages. Thus your site will get more language coverage. Currently Bing translator supports only 42 languages. See the demo below: 



This is how your translator will look like. When someone clicks on the Translate button, translation option will appear. After clicking the down arrow, a drop down list of language will open. 


Translator Code

To enable translation for your site, you've to add the following code in your HTML. 

<div id='MicrosoftTranslatorWidget' class='Darkstyle='color:white;background-color:#555555'></div><script type='text/javascript'>setTimeout(function(){{var s=document.createElement('script');s.type='text/javascript';s.charset='UTF-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';var p=document.getElementsByTagName('head')[0]||document.documentElement;p.insertBefore(s,p.firstChild); }},0);</script>


Copy and paste the above code in your site's HTML where you want this widget appear. This code works with almost any platform. 



Customize the Code

You can also customize this code. Look at the green texts. 

  • The first one is Dark. Dark looks fine when your site's background is light. But if your site is dark, then use Light instead of dark. 
  • The next one is Manual. That means someone needs to translate the page manually using the widget. But if you use the word Automatic, then your page will be automatically translated depending on the browser language! 
  • The last one is en. That means your site is in English - en. If your site's language is something else then you've to use the code of that language. For example, ar for Arabic, da for Danish, fr for French. Visit Translator Widget to see the codes for other languages. 


You can also change the background color of the widget using the color attribute. 



Implementing the Code in Blogger Blog

To use this code with blogger, follow the steps below:
  • Sign in to your blogger account and then go to your site's dashboard/ settings.
  • Now go to the Layout option from the left pane.
  • Choose Add a Gadget from anywhere (I prefer right sidebar).
  • Select HTML/ JavaScript option. 
  • Now copy and paste the Translator Code in the Content box. 
  • Save the gadget and view your site. 


Now when someone will translate your site, it will be translated within a second. And original text will also be displayed if you move your mouse over the text. To back to the original text, you have to cross the translator widget. 


Stay with Marks PC Solution to get more interesting IT topics!



0 nhận xét:

Đăng nhận xét