Showing posts with label twitter. Show all posts
Showing posts with label twitter. Show all posts

Friday, 19 June 2009

Real-time Google Translate for Twitter

Following on from my previous post about how to use a Greasemonkey script in Firefox to auto-translate Persian tweets in Twitter here's another way to get Persian tweets into English. The Google System blog has a good overview of how to do this but you're here, and this can be a little clearer.

Go to Google Translate and copy the following string of text http://search.twitter.com/search?q=%23iranelection&lang=fa (it's searching for tweets with #iranelection in Persian) into the search box...

Twitter's front-end interface doesn't give you the option of searching only Persian/Farsi tweets, but the search does seem to support it by adding lang=fa to the query string.

Sadly the AJAX updater won't tell you if new tweets have come in since you've been looking at the page, but you can just refresh your browser and it should pull out any new ones.


And you can get a Google Translate button for your web browser here. Once you've got the button, just click it whenever you have Persian text on a page and it'll translate it for you.

Translate Persian Twitter messages with Google Translate... automatically!

UPDATE: Cyrus Farivar has refined this quick tutorial. Having trouble with this? Follow his instructions on How to use Google Translate to translate Twitter messages from Persian.

Twitter is being used to provide real-time updates about what's happening in Iran. Following the exciting news about Google Translate now supporting Persian it's now possible to automatically translate Persian tweets into English (or any other Google Translate supported language).

Quick overview

To be able to automatically translate Persian Twitter messages, you will need...

  • The latest version of the Firefox web browser
  • Greasemonkey plugin (a Firefox plugin that allows you to customise web-pages with little bits of Javascript)
  • Google Translate user script for Twitter messages (add Google Translate button to your Twitter page)
  • Make some minor tweaks to the user script (because Twitter switched to HTTPS and the script was written before Google Translate supported Persian)
Step by step guide

1. Download and install the latest version of Firefox. Skip this step if you already run Firefox.

2. Install the Greasemonkey plugin for Firefox (you may need to restart Firefox after this step). Visit the page and click Add to Firefox...


3. Install the Google Translate user script. Visit the page and click Install...


4. Update the user script. It was written before Google Translate supported Persian and before Twitter ran on HTTPS. Do this via the form that appears when you install the script, or select Tools > Greasemonkey > Manager User Scripts. Or right-click the little monkey-face icon in the bottom-right corner of Firefox and choose Manage User Scripts.

5. Add in support for HTTPS by selecting Google Translate and then add in https://twitter.com/* and https://*.twitter.com/* to the list of Include Pages...

6. Edit the user script by clicking Edit in the bottom-left corner on the bottom right (above). Or you can edit google_translate.user.js. Add a new line at line 88 with fa: 'Persian',

7. Save your changes to your script and close the Manage User Scripts box

8. Check Greasemonkey is switched on (you may need to restart Firefox first) by going to Tools > Greasemonkey > Enabled...

9. Go to your Twitter page and login.

10. Find a tweet in Persian from one of your (new?) Iranian friends. Hover your cursor over the tweet and you'll see the favourite and reply icons appear, along with a new friend a lowercase 't'.

11. Click on the 't' icon and your friend's tweet is automatically translated from Persian into English!

Extra

If you don't speak English or want to translate into another language, you can set another language as the default.

This script doesn't just work for Persian/Farsi, it works for all Google Translate supported languages. And it auto-detects them. So, you can add new friends from around the world to your Twitter friends list!

Google Translate's Persian very far from perfect. Bear that in mind when you're using this script!

Tuesday, 16 June 2009

Google Translate, Facebook and iPhone now support Persian/Farsi

Google Translate adds Persian

I started writing a blog post just before voting began in the Iranian presidential election about the lack of a Persian option in Google Translate. With so much content on the web in Persian, it would have been great to be able to do a quick and rough machine translation into English.

Searching Google brought up no news about any new languages coming up in Google Translate. There are questions on mailing lists asking if it was going to happen, but those asking were always redirected to this FAQ saying large volumes of bi-lingual texts were needed.

But now Google Translate supports Persian (even though it's a very rough alpha version):

We feel that launching Persian is particularly important now, given ongoing events in Iran. Like YouTube and other services, Google Translate is one more tool that Persian speakers can use to communicate directly to the world, and vice versa — increasing everyone's access to information.

Being a machine translation, it's not perfect. It will certainly lose some of the flavour of Persian, the flourishes and idioms (which always lose something in translation), but it's a start. Cyrus Farivar has more on the accuracy, but seems glad it's finally here (as am I!). You can use Google Translate to translate BBC Persian into English, translate Persian tweets into English and now, the entire Persian blogosphere!

YouTube relaxes rules to help Iranians

Google also relaxed its rules on classifying videos on YouTube after graphic videos of violent attacks by Basij members on demonstrators were removed. Google lived up to its "don't be evil" motto (especially after the hurdles Iranians had to clear in order to upload their videos in the first place).

Facebook launches a Persian interface

hanks to the work of 400 Persian-speaking volunteers Facebook now has a Persian interface that automatically detect browser language and displays accordingly. The company says...

Since the Iranian election last week, people around the world have increasingly been sharing news and information on Facebook about the results and its aftermath. Much of the content created and shared has been in Persian—the native language of Iran — but people have had to navigate the site in English or other languages.

Great news and a triumph of collaborative working from those involved.

iPhone 3.0 supports Persian

People in Iran were some of the first to get jailbroken iPhones. With the highly anticipated version 3.0 of the iPhone OS, they've now got a legit Persian interface!

Pic taken from Cyrus Farivar's blog

Twitter switches to HTTPS for added security

Twitter switched over to HTTPS to ensure extra security for its web-based users. It could just be a coincidence, but I suspect its also a response to the popularity of the #iranelection hashtag and coverage the service has been getting. I'll be uploading a user guide to getting Google Translate and Twitter to work together.