Language switcher


Copyright : You can use the code below on your website as long as you keep a post with a link to my WordPress (http://radupoenaru.wordpress.com/) website on your WordPress website.

Since I moved my presentation site to WordPress hosting, I searched for a simple plugin or widget to allow me to have content in many languages. The basic idea is that if I wrote all in English, my older relatives ( whom learned French and Russian when Communism ruled ) wouldn’t be able to read it.

So where to find this precious tool? Initially I searched the plugins offered in WordPress specialized area, some were nice and interesting. But another problem arises – since it is a free hosting, you just can’t ask for these plugins, nor install them by yourself. Even the most popular ones, tried, tested and proven reliable by users weren’t integrated in WordPress hosting website.

Since it is the era of internationalization I believe that the builders thought that all of us learned already English.

Next I was thinking how to overcome this. And I came up with the idea presented below – use tags as switchers for different language articles.

MultiLang

For easy switching between languages, I added a HTML placeholder in Administration area -> Design ->Text widget and I placed him in the first position – feel free to add it as you like.

The text inside the widget is :

 
<table border="0" width="100%"> 
 <tr> 
  <td align="center" width="50%"> 
  <a href="http://radupoenaru.wordpress.com/tag/English"> 
  <img border="0" src="http://radupoenaru.files.wordpress.com/2008/10/en.jpg" alt="Select only posts in English language" /></a> 
  </td> 
  <td align="center" width="50%"> 
  <a href="http://radupoenaru.wordpress.com/tag/Romana"> 
  <img border="0" src="http://radupoenaru.files.wordpress.com/2008/10/ro.jpg" alt="Selecteaza doar mesajele in limba Româna" /></a> 
  </td> 
  </tr> 
</table>

I used a table just for effect, to evenly space the flag pictures.

I use the images below, uploaded in this message, because WordPress doesn’t allow media uploading separately – only included in a page.

The simplest way to do this was to include a language tag in the tags collection of each post. I use "English" for English posts and "Romana" for Romanian posts. So the main thing you should set after is one of the tags for each article in either Romana or English.

Switch to English Switch to Romanian

Leave a comment

Your email address will not be published. Required fields are marked *