2007
05.23

Larry Keiler asked me whether the Sodeve’s WP-Translate works on Blogger. The answer is no. This is because Blogger doesn’t use PHP (frankly, I’m don’t know. My hunch tells me it’s running on Python.)

I actually have written the JavaScript version of the plugin. You could see it running here.

Basically it consists of two parts, the JavaScript, and HTML. You could host the images in your own blogs, but it would be tedious to add the flags one by one. So I put them up at PhotoBucket. This way you can just copy and paste into your Blogger layout.

Javascript Part:

function translateURL(langcode){  
   var URL ="http://world.altavista.com/babelfish/trurl_pagecontent";  
   var curURL =self.document.URL;  
   var targetURL = URL; 

   if (curURL.indexOf(URL) != -1) { 
      if (langcode != '') { 
          targetURL = targetURL  + "?lp=" + langcode + "&url="; 
          targetURL = targetURL  + curURL.substring(curURL.indexOf('&url=')+5,curURL.length); 
      } 
      else { 
          targetURL = unescape(curURL.substring(curURL.indexOf('&url=')+5, curURL.length)); 
      } 
   } 
   else { 
      if (langcode != '') { 
         targetURL = targetURL + "?lp=" + langcode + "&url="; 
         targetURL = targetURL + escape(curURL);  
      }   
      else  { 
         targetURL=curURL;  
      } 
   }
   self.document.location = targetURL; 
} 

HTML Part:

<table style="border=0px;padding:5px;">
<tr>
<td ><img alt="Back to English" style="cursor:pointer;" onclick="translateURL('');" src="http://i154.photobucket.com/albums/s242/sodeve/uk.gif"  /></td>
<td ><img alt="English to German" style="cursor:pointer;" onclick="translateURL('en_de');" src="http://i154.photobucket.com/albums/s242/sodeve/germany.gif"  /></td>
<td ><img alt="English to Spanish" style="cursor:pointer;" onclick="translateURL('en_es');" src="http://i154.photobucket.com/albums/s242/sodeve/spain.gif"  /></td>
<td ><img alt="English to French" style="cursor:pointer;" onclick="translateURL('en_fr');" src="http://i154.photobucket.com/albums/s242/sodeve/france.gif"  /></td>
<td><img alt="English to Italian" style="cursor:pointer;" onclick="translateURL('en_it');" src="http://i154.photobucket.com/albums/s242/sodeve/italy.gif"  /></td>
<td ><img alt="English to Portuguese" style="cursor:pointer;" onclick="translateURL('en_pt');" src="http://i154.photobucket.com/albums/s242/sodeve/portugal.gif"  /></td>
</tr><tr>
<td ><img alt="English to Dutch" style="cursor:pointer;" onclick="translateURL('en_nl');" src="http://i154.photobucket.com/albums/s242/sodeve/netherlands.gif"  /></td>
<td ><img alt="English to Greek" style="cursor:pointer;" onclick="translateURL('en_el');" src="http://i154.photobucket.com/albums/s242/sodeve/greece.gif"  /></td>
<td ><img alt="English to Nippon" style="cursor:pointer;" onclick="translateURL('en_ja');" src="http://i154.photobucket.com/albums/s242/sodeve/japan.gif"  /></td>
<td ><img alt="English to Korean" style="cursor:pointer;" onclick="translateURL('en_ko');" src="http://i154.photobucket.com/albums/s242/sodeve/korea.gif"  /> </td>
<td ><img alt="English to Russian" style="cursor:pointer;" onclick="translateURL('en_ru');" src="http://i154.photobucket.com/albums/s242/sodeve/russia.gif"  /> </td>
<td ><img alt="English to Simplified Chinese" style="cursor:pointer;" onclick="translateURL('en_zt');" src="http://i154.photobucket.com/albums/s242/sodeve/china.gif"  /></td>
</tr>
</table>

So now how to add it to Blogger? Please follow this steps:

  1. Login to Blogger
  2. Go to Dashboard, then click Layout
    Blogger's Dashboard
  3. At the sidebar location. Click “Add a Page Element”
     Blogger - Add a Page Element
  4. A new window will pop-up. Select ‘HTML/Javascript’, click ‘Add to Blog’
  5. You now will have a text box and a text area. Leave the title blank. Copy the code described in the ‘Javascript Part’, then paste it in the text area. Then copy the code from ‘HTML Part’, and paste it also in the text area. Inside the text area, separate the Javascript and the HTML with one line.

You are good to go. If you like this tips, I would be grateful if you link-back to this blog. Thanks.

Good luck with your Blogger (^_^)/

List of Bloggers that use Sodeve’s WP-Translate, Blogger Edition:

  1. My Demo Site
  2. Your Blog?
GD Star Rating
loading...
Worth sharing ?

Incoming Search Term

Advertise Here

 

3 comments so far

Add Your Comment
  1. I am giving it a try and I will be back to let you know how it performs. Fingers crossed !

  2. … a couple of seconds later… all works fine, I love my English blog turned into simplified Chinese ! I am really impressed and grateful.
    Thank you.

  3. hi Sodeve

    I tried your plugin to my blog and it works like a charm!! By the way, I am using the old style of Blogger template, so, i copied the Javascript as well as the HTML manually to my template.

    Keep up the good work!