Tuesday, October 14, 2008

Linux Command Line Language Translation

Hey there,

Well, it's been a long time since we came out with our bash script for command line language translation, and we've finally gotten our head's out of the figurative bowl of spaghetti and found a great online project that already handles this sort of thing. No problem there, of course. If there really is more than one way to skin a cat, you need to know all those different ways or you'll end up skinning your cat the same way over and over ;)

The GNU Site has a great project download called twandgtw, which translates, loosely, into "Translate Word and Graphical Translate Word" (Basically, you can run it from the CLI, but it does have a X-Windows component, as well. Actually, there are three separate packages you can download: tw, gtw or ktw (first revision of a front-end for KDE).

You can download straight-up RPM's for Fedora Core 6 through 7 from the main download page, which also includes tar.bz2 zipped-up source-code tarballs. If you don't have bzip2, you can pick it up here. bzip2, like tar, is pretty standard nowadays, and probably comes with whatever version of Linux you're running.

The software, itself, is incredibly easy to use, and, while the local dictionaries can only handle one word at a time, you can also use online services to translate entire phrases. tw uses www.freetranslation.com and translate.google.com for online translations. To translate a word, you need to specify a dictionary (use the --list option to see all of them, including the available online translators) and a word. For instance, this is what we go when we ran a test using the "en-es" (English to Spanish) built-in dictionary and the word "money":

host # tw en-es money
moneybag : monedero
moneybelt : riA±onera
money : dinero
moneyed : adinerado
moneylender : prestamista
waste of money : malgasto


Below is a screen capture of what the graphical tool looks like (Since we didn't install the graphical element ourselves, this screen shot is from Tuxmind.org):

Click below to enlarge this picture and remove all the jittery stair-stepping effects ;)



If you're looking for software out there to make language translation really really simple, we'd suggest you check this out, even though we've already written our own scripted version, (Yes, we're admitting this is better ;)

Cheers,

, Mike




Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.