twtlang: un service de traduction en utilisant Twitter et Google.
I made another Twitter… thing. In the tradition of twtdict, I give you: twtlang. What does twtlang do? I’m glad you asked.
twtlang mashes up Twitter and the Google Translate service. It works pretty much the same way twtdict does. Send it a phrase, tell it what language you want it in, and it will send back the translation, if it can.
Since a sentence is a little more nebulous than a single word, I had to change the way the service parses the tweets. The structure is a little more important. Basically, they have to be sent like this:
@twtlang “I would like this in French, please.” fr
You’ll get this in a Direct Message:
Je voudrais que cela en français, s’il vous plaît.
If you tack a @ on the end, you’ll get an @reply instead, just like twtdict.
Obviously there are some limitations. For one, the Google translate service will detect what language the request is in, so I only needed to specify the target language. Unfortunately, it doesn’t do so well on shorter phrases. I requested a German translation of “shit” and all I got back was “shit.” (Just tried with French and it worked. Merde.) It seems to work better with longer phrases. I thought about making a way to specify the initial language but didn’t want to get too cryptic or “code-y” (as in, @twtlang “translate this” en>fr). Or maybe I was just lazy. I don’t know. I might change it if necessary.
Also, it does nothing for pronunciation. So if you want to know how to say “什么他妈的这是否说的?”, you’re on your own. I suppose if you are actually in China, you could just show it to someone, if your phone will display the characters. Mine doesn’t display them in text messages. Haven’t tried Opera mobile yet.
Like twtdict, the service is based on a cron job that runs every 5 minutes, to keep from getting blacklisted by Twitter. Also like twtdict, I’ll apply for whitelisting if necessary.
You can find a list of available languages on the twtlang page. (Interestingly, if I request a full list of languages from Google, Esperanto is listed, but it doesn’t work, and Esperanto is not listed in the drop down at the Google Translate site.) They’re pretty much the standard country codes, so you probably already know most of the more common ones.
I don’t really know why I made this, other than I thought it’d be interesting. I may get some use out of it this summer when I head to Manitoulin Island, Ontario, Canada for my grandmother’s 80th birthday. (She’s not Canadian. My family has a cabin on the island.) I haven’t been there in 14 or 15 years but I think there are some French-speaking Canadians in the nearest town. Maybe I can use this to ask where the bathroom is.
Où est la salle de bains?
Facebook comments: