{"id":2303,"date":"2009-06-20T00:43:52","date_gmt":"2009-06-20T07:43:52","guid":{"rendered":"http:\/\/cyrusfarivar.com\/blog\/?p=2303"},"modified":"2009-06-20T00:43:52","modified_gmt":"2009-06-20T07:43:52","slug":"how-to-translate-persian-twitter-messages-automatically","status":"publish","type":"post","link":"https:\/\/cyrusfarivar.com\/blog\/2009\/06\/20\/how-to-translate-persian-twitter-messages-automatically\/","title":{"rendered":"How to translate Persian Twitter messages automatically"},"content":{"rendered":"<p><a href=\"http:\/\/www.flickr.com\/photos\/cfarivar\/3642664733\/\"><img decoding=\"async\" src=\"http:\/\/farm4.static.flickr.com\/3331\/3642664733_b585438ded_d.jpg\"\/><\/a><\/p>\n<p>The Iranophile blog &#8220;<a href=\"http:\/\/isthistaarof.blogspot.com\/2009\/06\/translate-persian-twitter-messages-with.html\">Is this Ta&#8217;arof?<\/a>&#8221; shows how to use Greasemonkey and the <a href=\"http:\/\/cyrusfarivar.com\/blog\/?p=2293\">new Google Translate tool<\/a> to help better understand what&#8217;s being said in Persian on Twitter. Of course, <a href=\"http:\/\/translate.google.com\/translate_t#en|fa|Hi%2C%20my%20name%20is%20Cyrus.\">Google&#8217;s translation ability<\/a> is still in alpha, and likely isn&#8217;t 100 percent accurate, but it&#8217;s better than nothing. This should work on Windows, Mac or Linux equally well.<\/p>\n<p>If you&#8217;re not techy and don&#8217;t understand the difference between a cup of java and JavaScript, fear not! This takes about a minute to set up once you&#8217;ve got the pieces in place and is super, super easy. (Seriously.)<\/p>\n<p>I&#8217;ve adapted John&#8217;s instructions to make them a little more clear and a little easier.<\/p>\n<p>So, here&#8217;s what you&#8217;ll need to download first:<\/p>\n<p><a href=\"http:\/\/cyrusfarivar.com\/google_translate.farivar.js\">[0) New version.]<\/a><\/p>\n<p>1) <a href=\"http:\/\/www.mozilla.com\/firefox\/\">Firefox<\/a> browser. (If you have this already, then skip this step)<\/p>\n<p>2) <a href=\"https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/748\">Greasemonkey<\/a>. (This a really sweet Firefox plugin that lets you, as John <a href=\"http:\/\/isthistaarof.blogspot.com\/2009\/06\/translate-persian-twitter-messages-with.html\">writes<\/a>: &#8220;allows you to customize web-pages with little bits of Javascript. Or, as <a href=\"http:\/\/www.wired.com\/wired\/archive\/13.09\/start.html?pg=7\">Paul Boutin<\/a> once wrote: &#8220;[lets you] modify webpages to suit your tastes.&#8221;) Again, if you already have this, you can skip this step.<\/p>\n<p>3) Once you&#8217;ve got those squared away, go download <a href=\"http:\/\/cyrusfarivar.com\/docs\/iran\/google_translate.user.js\">my modified Google Translate script<\/a> 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.<\/p>\n<p>In John&#8217;s version, he&#8217;ll tell you to go <a href=\"http:\/\/userscripts.org\/scripts\/show\/43115\">download the script<\/a> from the official userscripts.org site. Then you&#8217;ll have to modify one line of code, as the script hasn&#8217;t been updated since Google added Persian.<\/p>\n<p>But I&#8217;ve already done that for you, so you can download my already-modified version <a href=\"http:\/\/cyrusfarivar.com\/docs\/iran\/google_translate.user.js\">instead<\/a>.<\/p>\n<p>4) Now we&#8217;ve got to make a tiny change to the Google Translate script to make sure that it supports HTTPS. (If that doesn&#8217;t mean anything to you, then don&#8217;t fret over it.) <\/p>\n<p>You can do this straightaway when the pop-up appears when you install the script. Or, you can go to the Tools menu, select &#8220;Greasemonkey&#8221; and then select &#8220;Manage User Scripts.&#8221; Or, you can right-click (that&#8217;s Ctrl-click for Mac people like me) the monkey icon in the lower right corner of your browser window and choose &#8220;Manage User Scripts.&#8221;<\/p>\n<p>No matter how you do it, you should get a screen like this:<\/p>\n<p><center><a href=\"http:\/\/4.bp.blogspot.com\/_M2Z8lUP2G74\/SjttlOsK2RI\/AAAAAAAAAL0\/kdl3aRnUVoQ\/s1600-h\/manage-user-scripts.gif\"><img decoding=\"async\" src=\"http:\/\/4.bp.blogspot.com\/_M2Z8lUP2G74\/SjttlOsK2RI\/AAAAAAAAAL0\/kdl3aRnUVoQ\/s320\/manage-user-scripts.gif\"\/><\/a><\/center><\/p>\n<p>Click the &#8220;Add&#8230;&#8221; button and put in this line:<\/p>\n<p>https:\/\/twitter.com\/*<\/p>\n<p>Do it again for:<\/p>\n<p>https:\/\/*.twitter.com\/* <\/p>\n<p>Now there should be four lines in the &#8220;Included Pages&#8221; box as shown above.<\/p>\n<p>5) Restart Firefox.<\/p>\n<p>6) Login to Twitter. (This is important.)<\/p>\n<p>7) Go to a Twitter page with Persian text on it, like:<\/p>\n<p><a href=\"http:\/\/twitter.com\/mousavi1388\">http:\/\/twitter.com\/mousavi1388<\/a><br \/>\n<a href=\"http:\/\/twitter.com\/khorshid\">http:\/\/twitter.com\/khorshid<\/a><br \/>\n<a href=\"http:\/\/twitter.com\/khamenei_ir\">http:\/\/twitter.com\/khamenei_ir<\/a><\/p>\n<p>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 &#8220;t.&#8221; If you click that then you should get something like this:<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/cfarivar\/3642664733\/\"><img decoding=\"async\" src=\"http:\/\/farm4.static.flickr.com\/3331\/3643472402_9730b9f1c6_o_d.jpg\"\/><\/a><\/p>\n<p>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.<\/p>\n<p>Any questions? Contact me. <\/p>\n<p>Email is cfarivar [at] cfarivar [dot] org or find me on Twitter: @cfarivar<\/p>\n<p>[via <a href=\"http:\/\/www.poynter.org\/content\/content_view.asp?id=165467\">Poynter<\/a>] <\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Iranophile blog &#8220;Is this Ta&#8217;arof?&#8221; shows how to use Greasemonkey and the new Google Translate tool to help better understand what&#8217;s being said in Persian on Twitter. Of course, Google&#8217;s translation ability is still in alpha, and likely isn&#8217;t 100 percent accurate, but it&#8217;s better than nothing. This should work on Windows, Mac or Linux equally well. If you&#8217;re not techy and don&#8217;t understand the difference between a cup of java and JavaScript, fear not! This takes about a&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[53,70,96],"tags":[],"class_list":["post-2303","post","type-post","status-publish","format-aside","hentry","category-election-1388","category-geekery","category-iran","post_format-post-format-aside"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4uks-B9","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cyrusfarivar.com\/blog\/wp-json\/wp\/v2\/posts\/2303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cyrusfarivar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cyrusfarivar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cyrusfarivar.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cyrusfarivar.com\/blog\/wp-json\/wp\/v2\/comments?post=2303"}],"version-history":[{"count":0,"href":"https:\/\/cyrusfarivar.com\/blog\/wp-json\/wp\/v2\/posts\/2303\/revisions"}],"wp:attachment":[{"href":"https:\/\/cyrusfarivar.com\/blog\/wp-json\/wp\/v2\/media?parent=2303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cyrusfarivar.com\/blog\/wp-json\/wp\/v2\/categories?post=2303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cyrusfarivar.com\/blog\/wp-json\/wp\/v2\/tags?post=2303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}