Marco's Blog

All content personal opinions or work.
en eo

Habla Espanol? Chat Translation in Pidgin

2013-01-01 6 min read Software marco

logo.pidginI have a new surfing buddy in Mexico. He doesn’t speak much English, I am struggling with Spanish. It works fine in the water, because we just nod and congratulate when we hit a good wave – the expression of joy doesn’t need translation. Organizing a trip, though, was a nightmare until recently.

I figured out that instant messaging was a good solution. I could type something in English into Google Translate, which is good enough for communication (although at times hilarious). I would then copy and paste the translation into the client. He would read and reply, usually doing as I did.

The process works, but is slow. So I started looking at something that would automate the copy/paste part. I needed a tool that would take what I typed, translated it into the target language, and then translated the reply back to me. In essence, I would have a conversation in English, and my friend would have a conversation in Spanish, and the tool in-between would be the interpreter.

Guess what, i found the solution. It’s the purple-translation plugin for Pidgin. It works like a charm, and aside from getting occasional snide comments about the fact that “you don’t say it that way,” the other end frequently forgets that I speak none of their language. And I tested that with a friend in Russia, one in France, and one in India.

What Is Pidgin?

Pidgin, formerly known as Gaim (until a copyright/trademark claim from AOL) is a multi-protocol client. It allows you to connect to a wide variety of instant messaging networks from a wide variety of platforms. Pidgin is available as a client for Windows, Mac OS, and Linux (currently). It supports a gazillion different networks, from the pedestrian AIM and Yahoo, to the newer Facebook and Google, to the off-beat Steam and Xfire. If you are chatting with it, there is probably a plugin for that.

Pidgin, though, is more than just a multi-protocol, multi-platform client. You can extend its functionality with additional plugins that do all sorts of weird and interesting things. A very interesting plugin is Off-The-Record (OTR), a plugin that transparently encrypts your messages with someone else so that only you and that person can read them. This is to get around the problem that the messaging servers typically read what you are typing, and potentially makes use of that information.

Another plugin notifies you of incoming messages by changing the keyboard LEDs. Another one (called psychic mode) tells you that someone typing a message even before that message is sent. Another chooses your IM status based on Facebook or Twitter updates. Another puts the last messages from the last session you had with a user into the current window (oh, so precious when you inadvertently closed a window).

In short, Pidgin is a true master of communication. There are things I’d love to see – like an Android of iOS port. But as it stands, it’s a marvelous application that just isn’t used nearly enough.

Purple Translate

One of the hundred or so available third party plugins is Purple Translate. Purple is the internal code name for the instant messaging core (it was some play on the initials PRPL that stand for something nobody cares about).

When I first downloaded the plugin from the web page above, on Windows, I was slightly suspicious. After all, the source code hadn’t been updated in a very long while (a year?). When I fired it up, it promptly crashed, no matter what I did.

I needed the functionality, so I did what every self-respecting nerd would do and downloaded the source code and built it. Same issue. Before proceeding, I realized it made no sense to do any work without consulting the author and offering to take over the project if he wasn’t interested in it anymore. I did and it turned out that the project owner is a really nice guy, who replied almost instantly and gave me the hints I needed (although he still doesn’t have time to fix the plugin).

It turns out (and this is an important tip for all of you that went on to download the plugin) that Google Translate capability doesn’t work any longer. That’s because Google disallowed API access to the translation tool (always in accordance with their motto, Don’t Be Evil…. whatever). Microsoft Translate, though, still works well. Unfortunately, Google Translate is turned on by default, so that by default the plugin will crash and burn, giving you the impression it doesn’t work at all.

How Does It Work?

In the most basic functionality, you tell the plugin your source language (the language you are going to use), and it will detect the language on the other end as soon as the other end types a message. If you want to send a message, you select the contact, right-mouse it, go to the menu item Translate, and select the language (the list is comically large).

Let’s say, for argument’s sake, that my Mexican friend wants to send me a message. He’d start by typing something like, “Hola, chico!” What I would see is “Now translating from Spanish. Hey, dude!”

I would then type my reply: “Hey, man!” My friend sees, “Hola, hombre!”

And it goes on like this.

The Quality of Translations

Automated translation is still not all too good. It falls particularly flat when you use language-dependent idioms, and there are tons of those, and we are not aware of using them most of the time. Sometimes you say a phrase one way in one language, but that way doesn’t come across too well.

But for the conveyance of information – like the scheduling of a surf trip – automated translation is just perfect. In the end, you just need to exchange availability and directions, and there is nothing idiomatic about that.

Now, I would be a little cautious about having a romantic or erotic affair on auto-translate. But I recall that my mother (who spoke only German) and my father (who spoke only English) used to write each other letters using a dictionary, and my mother ended up calling my father a “rotten rabbit,” which apparently is a cozy playful idiom in German (and then you wonder why they started two world wars, right?).

Oh, Last Comment

The purple-translate plugin is available on the download page as source code, or as Windows DLL and Linux .so for 32-bit systems. I do not know what versions of Pidgin that matches, but obviously the Linux version won’t work on 64-bit systems like the Acer netbook on which I am typing. I downloaded the source and built it, but it was a pain (mostly because of having to download all the build dependencies). If you are in need of a 64-bit version, here is the .so. As usual, this is totally at your own risk, I loaded the .so with malware that is going to eat your computer and turn you into a clap-infected zombie, and don’t you ever think of asking me for help, advice, or to marry your daughter.

{jd_file file==purple-translate.so}