browse by category or date

Hi all. I have managed to patch the WP-Translate and tested it on WordPress 2.2.

Current Version: 2.2

Overview

WP-Translate is a simple drop in way for users to view your blog in their language. Its easy for any most users to add this functionality to their site.

WP-Translate utilizes the following Online translation services:

  1. Alta Vista’s Babel Fish (for translation from English to : French, German, Italian, Dutch, Spanish, Greek, Russian, Portuguese, Japanese, Korean, Simplified/Traditional Chinese)
  2. IBM’s Websphere Translation (for translation from English to: Brazilian Portuguese)
  3. Interpret (for translation from English to: Bahasa Indonesia, Swedish, Norwegian, Afrikaans)

WP-Translate 2.2 Release Notes

Added the following language for translation:

  1. Swedish
  2. Norwegian
  3. Bahasa Indonesia
  4. Afrikaans
  5. Chinese Traditional
  6. Brazilian Portuguese

Requirements

WP-Translate works with WordPress 1.5 up to WordPress 2.2 (Tested on WordPress 2.2)

Your web server should able to execute PHP.

Installation instructions

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

Special Installation instructions for non-Wordpress users

As I mentioned before, as long as your Web server supports PHP you should be able to use this plugin. 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.

Download Sodeve’s WP-Translate 2.2

The previous version can be found here:Sodeve’s WP-Translate 2.1

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.

Update: 5 June 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:

I like MS Paint for its simplicity. It’s small, fast, and quite handy for creating a simple button/banner (Like the one you see below Capt. Jack Sparrow’s picture on the sidebar).

Until I found Paint.NET. This program’s loading time is slower to MS Paint by less than 1 second. So it’s nothing to complain. The interface is almost similar to MS Paint

Some feature comparison between MS Paint and Paint.NET:

FeaturesMS PaintPaint.NET
Tabbed document interfacenoyes
Layersnoyes
Live thumbnailnoyes
Number of Colors Supported28 (although you can select other colors by going through the menu: Colors – Edit Colors – Define Custom Colors)alot 😛
Special Effects (sharp, blur, emboss, distortion, etc.)noyes

And a lot more features …

And the best part, it’s open source. The online community is very active. So you can expect many plugins written by the community.

Paint.NET Minimum System Requirements:

  • Windows XP (SP2 or later), or Windows Vista, or Windows Server 2003 (SP1 or later)
  • .NET Framework 2.0
  • 500 MHz processor (Recommended: 800 MHz or faster)
  • 256 MB of RAM (Recommended: 512 MB or more)
  • 1024 x 768 screen resolution
  • 200+ MB hard drive space
  • 64-bit support requires a 64-bit CPU that is running a 64-bit version of Windows XP, Windows Vista, or Windows Server 2003, and an additional 128 MB of RAM

Get Paint.NET Now!!!

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:

GUI Programming used to be one of my nightmare in programming. I had a hard time understanding the concept and implemented it in my Windows Application. The good news is, I now know a little bit about it (^_^)/. Now by writing it into a blog post, I actually helping myself to understand the concept better, and hopefully, it might help others in one way or another. 🙂

In this project, we will create a stopwatch (might be useful to track-down how long you need to create a blog post (^_^)/ ). OK, now please open your Visual Studio, and create a Windows Application. Name the project ‘ThreadingGUI_02’. After that, design the form to look something like this:
threading_02_form.png

So the idea is to create a process that will have a counter, increase the counter value and update the GUI every 0.1 seconds. In order to keep the GUI responsive to user’s actions, the actual processing should be done in different Thread. We also need to create a delegate, this way the the worker thread will be able to access the GUI thread and updates the corresponding labels.

Form1.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace ThreadingGUI_02
{
   public delegate void RefreshGUI(int i);

   public partial class Form1 : Form
   {
      Worker w;
      RefreshGUI myUpdateCounter;
      Thread t;
      public void UpdateCounter(int c)
      {
         if (this.InvokeRequired)
         {
            this.Invoke(myUpdateCounter, c);
         }
         else
         {
            int ms = c % 10;
            int second = (c / 10) % 60;
            int minute = (c / 600) % 60;
            int hour = (c / 36000) % 24;
            this.lblHour.Text = hour.ToString("00");
            this.lblMinute.Text = minute.ToString("00");
            this.lblSecond.Text = second.ToString("00");
            this.lblMiliSecond.Text = ms.ToString("0");
         }
      }
      public Form1()
      {
         InitializeComponent();
         myUpdateCounter = new RefreshGUI(UpdateCounter);
         w = new Worker(myUpdateCounter);
         t = new Thread(new ThreadStart(w.Counting));
         t.Start();
      }

      private void button1_Click(object sender, EventArgs e)
      {
         Button b = (Button)sender;
         b.Text = b.Text == "Start" ? "Stop" : "Start";
         w.isCounting = b.Text == "Stop";
         this.button2.Enabled = b.Text == "Start";
      }

      private void button2_Click(object sender, EventArgs e)
      {
         w.count = 0;
         int c = 0;
         int ms = c % 10;
         int second = (c / 10) % 60;
         int minute = (c / 600) % 60;
         int hour = (c / 36000) % 24;
         this.lblHour.Text = hour.ToString("00");
         this.lblMinute.Text = minute.ToString("00");
         this.lblSecond.Text = second.ToString("00");
         this.lblMiliSecond.Text = ms.ToString("0");
      }

      private void Form1_FormClosed(
         object sender, 
         FormClosedEventArgs e)
      {
         t.Abort();
         t = null;
      }

      private void label5_Click(
         object sender, 
         EventArgs e)
      {

      }
   }
}

Add a new class, and name it Worker.cs:

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace ThreadingGUI_02
{
   class Worker
   {
      RefreshGUI update;
      public bool isCounting;
      public int count = 0;
      public Worker(RefreshGUI d)
      {
         update = d;
         isCounting = false;
      }
      public void Counting()
      {
         while (true)
         {
            if (isCounting)
            {
               ++count;
               if (update != null)
                  update(count);
            }
            Thread.Sleep(100);
         }

      }
   }
}

So as you see in the codes above, the logic of program would be:

  1. the main thread (a.k.a the GUI thread) instantiates the delegate
  2. GUI thread instantiates the worker thread, and pass the delegate object to worker thread object
  3. GUI thread starts the worker thread object
  4. the worker thread updates the GUI thread object using delegate
  5. the worker thread sleeps for a 0.1 seconds (If you do not need the 0.1 seconds delay, you could comment the Thread.Sleep(100); line)

This is example is not really a good example in threading since we never protect the ‘Critical Section‘ of the program with Mutex/Semaphore. Maybe in the future we will discuss how to prevent deadlock using Mutex/Semaphore.

For those who are lazy to copy and paste (^_^) into their Visual Studio, you can download the project solution: Threading GUI – Stopwatch

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: