Hamid Fadishei's Blog

February 25, 2011

Writing RTL Notes on Zotero

Filed under: Research — fadishei @ 10:45 am
Tags: , , , , ,

Update (2012-08-16): I’ve patched the Zotero source and posted a pull request on github. I asked Zotero developers to add this feature to the main distribution. Please support it by asking the Zotero developers to merge the pull request via email or forum.

Pull request page: https://github.com/zotero/zotero/pull/157
Related forum post: http://forums.zotero.org/discussion/10879

Update: The procedure in this post does not work on new Firefox versions as it disables plugins which are modified after installation. For an updated and better procedure, please visit here.

Zotero is the software for researchers and in my opinion, it is a must. It helps you organize your references, add tags and notes to them, search them, and do a lot more things. The first day that I met this research tool, I said to myself: “The water is in the jug and I am looking for it around the world”! (This is a Persian idiom, which is used when you find out something you really missed was in fact near you).

As a Persian native, one thing that zotero lacked for me was the support of RTL languages in its note editor. After some goolging and reading a useful post on the Zotero forum, I managed to add the RTL and LTR buttons to its built-in editor. If you need the support of RTL languages (such as Arabic, Hebrew, and Persian) in Zotero then this blog post may help you. I hope that Zotero team will add this functionality to the main zotero release so that RTL people do not have to patch their installation for it.

The procedure is for the latest stable release at the moment which is zotero-2.0.9. I assume that you have Zotero installed and my instructions are for a Linux environment. You should patch the RTL functionality into built-in tinyMCE editor which resides in zotero.jar.

First of all, make a working directory and find and unpack zotero.jar there:

$ mkdir -p ~/work/zotero
$ cd ~/.mozilla
$ find -name zotero.jar
$ cp ./firefox/z4qwdrwe.default/extensions/zotero@chnm.gmu.edu/chrome/zotero.jar ~/work/
$ cd ~/work/zotero
$ jar -xf ../zotero.jar

Then you should download the same version of tinyMCE as the one in zotero.jar and add the extra tinyMCE files that are not available in the zotero.jar to it. In order to find out what version it is you can look at tiny_mce.js.

$ cat content/zotero/tinymce/tiny_mce.js | grep Version
   majorVersion : '3',
   minorVersion : '3.9.2',
$ cd ..
$ wget http://downloads.sourceforge.net/project/tinymce/TinyMCE/
$ unzip tinymce_3_3_9_2.zip
$ cp -au tinymce/jscripts/tiny_mce/* zotero/content/zotero/tinymce/

The third step is to enable directionality plugin. Go this way:

$ cd zotero
$ vi content/zotero/tinymce/note.html
    plugins : "paste,contextmenu",
    plugins : "paste,contextmenu,directionality",

    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,sub,sup,|,forecolor,backcolor,|,blockquote,|,link,unlink",
    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,sub,sup,|,ltr,rtl,|,forecolor,backcolor,|,blockquote,|,link,unlink",

Now you can compress your new zotero.jar and move it back into where you found it in the first step:

$ jar -cf zotero.jar *
$ mv zotero.jar ~/.mozilla/firefox/z4qwdrwe.default/extensions/zotero@chnm.gmu.edu/chrome/

You should (re)start your firefox now. If everything goes OK, you will have two new buttons in your browser: RTL and LTR.

Create a free website or blog at WordPress.com.