How to translate Persian Twitter messages automatically

The Iranophile blog “Is this Ta’arof?” shows how to use Greasemonkey and the new Google Translate tool to help better understand what’s being said in Persian on Twitter. Of course, Google’s translation ability is still in alpha, and likely isn’t 100 percent accurate, but it’s better than nothing. This should work on Windows, Mac or Linux equally well.

If you’re not techy and don’t understand the difference between a cup of java and JavaScript, fear not! This takes about a minute to set up once you’ve got the pieces in place and is super, super easy. (Seriously.)

I’ve adapted John’s instructions to make them a little more clear and a little easier.

So, here’s what you’ll need to download first:

[0) New version.]

1) Firefox browser. (If you have this already, then skip this step)

2) Greasemonkey. (This a really sweet Firefox plugin that lets you, as John writes: “allows you to customize web-pages with little bits of Javascript. Or, as Paul Boutin once wrote: “[lets you] modify webpages to suit your tastes.”) Again, if you already have this, you can skip this step.

3) Once you’ve got those squared away, go download my modified Google Translate script for Greasemonkey. This is the little bit of code that will do the translation for you. There probably will be a pop-up window asking if you want to install this script. You do.

In John’s version, he’ll tell you to go download the script from the official userscripts.org site. Then you’ll have to modify one line of code, as the script hasn’t been updated since Google added Persian.

But I’ve already done that for you, so you can download my already-modified version instead.

4) Now we’ve got to make a tiny change to the Google Translate script to make sure that it supports HTTPS. (If that doesn’t mean anything to you, then don’t fret over it.)

You can do this straightaway when the pop-up appears when you install the script. Or, you can go to the Tools menu, select “Greasemonkey” and then select “Manage User Scripts.” Or, you can right-click (that’s Ctrl-click for Mac people like me) the monkey icon in the lower right corner of your browser window and choose “Manage User Scripts.”

No matter how you do it, you should get a screen like this:

Click the “Add…” button and put in this line:

https://twitter.com/*

Do it again for:

https://*.twitter.com/*

Now there should be four lines in the “Included Pages” box as shown above.

5) Restart Firefox.

6) Login to Twitter. (This is important.)

7) Go to a Twitter page with Persian text on it, like:

http://twitter.com/mousavi1388
http://twitter.com/khorshid
http://twitter.com/khamenei_ir

VIII. Move your mouse over the Persian text. On the right side, under the Favorites star and the reply-to folded arrow should be a new, lower-case letter “t.” If you click that then you should get something like this:

NB: You can modify the script to default to a different source language. Also, this script works with any of the Google-supported target languages, which include Arabic, Korean and Estonian.

Any questions? Contact me.

Email is cfarivar [at] cfarivar [dot] org or find me on Twitter: @cfarivar

[via Poynter]

13 Replies to “How to translate Persian Twitter messages automatically”

  1. ????? “?????? ??? ?????” ????? ???? ?????? ????? ?? ???? ?? ???? ???? “???????” ?? ????? ??? ??? ???? ???!
    It seems that “Stalin” run’s Iran! , “ironic gates” policy of ex U.S.S.R now runs on media systems in Iran.
    ?? ???? ?? ?? ???? ???? ????? ???? ???? ??????:
    ?????? ?? ????? ???? ??(??? ???) ?? ???? ???? ?? ????? ? ???? ????? ???? ?? ?? ?? ???? ?? ?????? ??? ?? ?????? ?? ?????? ??? ??????? ?? ????.
    (PESTISEID SPRAY + FLAME) IS GREAT WEAPON!

  2. There’s a much easier way to translate your tweets to/from Farsi (and dozens of other languages). Check out tweetrans.com Just send a reply to TweeTrans, tell it which language to translate to, and it will reply back with the translation, then just copy and paste as your tweet. For example, to test English to Farsi, send this: @TweeTrans 2fa this is a test. (the 2 means “to” and “fa” is the code for Farsi; all codes can be found at TweeTrans.com) Hope this helps!

  3. Pingback: Utica Boilermaker
  4. By the agency of your blog, please allow me introduce our own, we are oriental rug manufacturer and won’t harm your business. I’m Danna Zhang from Bosi Carpet, we mainly design and manufacture hand-knotted oriental rugs and carpets, aubusson, needlepoint and handmade tapestry. If you are interested, please visit http://www.bosi-carpet.com, thanks very much.

Comments are closed.