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 ="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:/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>
</tr><tr>
<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>
</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?

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.

Possibly relevant:

A few days back, Dorota asked me to share the trick of those flags under this blog title. So here you are the WordPress plugin.

This plugin initially developed by Scott Hough. The original translation service used was Google Translate. But I was disappointed by the frequent errors thrown by Google Translate. Another bug was, you cannot translate more than once. To translate into other language, you need to go back to the original page and click different flag.

Requirements:

  1. Your blog must be written in English. This is because only this language can be translated into many languages by Babel Fish.
  2. You are using WordPress 1.5 and above. It’s tested in WordPress 2.1 (this blog (^_^)v )
  3. You have access to install the plugin

Installation and Usage Guide:

  1. Extract the zip file, upload the wp-translate directory to your plugins folder, usually wp-content/plugins/
  2. Activate the plugin on the plugin screen.
  3. Add <?php translate(n); ?> to your template where you want the flags to be displayed. n can be either 1 or 2. 1 is for a vertical display. 2 makes it horizontal.

For non WordPress user, you can still use this plugin provided your Web Server supports PHP. To do so, please follow this steps:

  1. Extract the zip file
  2. Edit wp-translate.php which is located in wp-translate directory
  3. At line 103, replace $img_loc = get_settings(’siteurl’) . ‘/wp-content/plugins/wp-translate’; with $img_loc = ‘/wp-translate’;
  4. Save the file
  5. Upload the wp-translate directory to your root folder.
  6. In the page you want the flags to be displayed, put <?php include_once(realpath($_SERVER[‘DOCUMENT_ROOT’]).’/wp-translate/wp-translate.php’); ?> in the first line of the file.
  7. Add <?php wptranslate(n); ?> anywhere you want the flags to be displayed. n can be either 1 or 2. 1 is for a vertical display. 2 makes it horizontal.

If you like this plugin, please link-back to this post, or add me to your blog-roll. Would be greatly appreciated. Thank you.

Having problem with installing the plugin? You have ideas for the plugin? Post a comment and I will try my best to help you.

Download:
Sodeve’s WP-Translate 2.1

Update: 19 May 2007

Users of this plugin:

  1. Myself (^_^)v
  2. Founders Cafe
  3. Your Blog?

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.

Possibly relevant:

black spidey

Deus ex machina describes an unexpected, artificial, or improbable character, device, or event introduced suddenly in a work of fiction or drama to resolve a situation or untangle a plot (e.g. having the protagonist wake up and realize it was all a dream, or an angel suddenly appearing to solve problems).

So how did Deus ex Machina ruined Spider-Man 3? Well, the most obvious one is Bernard, the servant in Osborn’s penthouse. Why he finally informed Harry Osborn the story that make him forgive Peter Parker and helped Spidey to fight Venom and Sandman now? Why not in Spider-Man 2? Did you spot other deus ex machina in the movie?

The overall movie is quite a disappointment for me. The CGI offers nothing new, the plot is weaker than the first and the second instalment of the Trilogy. I am really sure Tobey Maguire will not win Oscar for his crying act (^_^)v. Pff.. enough with the disappointment, I’ll hyped up myself for Pirates of Caribbean 3. Hopefully dear old Jack will make a blast ending to the trilogy.

Heck, at least I’m not the only one thinking that Spider-Man 3 sucks.

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.