browse by category or date

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 ="";  
   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  { 
   self.document.location = targetURL; 

HTML Part:

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

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

Possibly relevant:

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

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!