Hamid Fadishei's Blog

January 29, 2012

Adding RTL (Right-to-Left) Support to Zotero

Filed under: Research,Uncategorized — fadishei @ 3:09 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

In a previous post, I wrote about Zotero and the lack for supporting RTL languages in its note editor and how to work around this problem. In this post a better procedure for adding RTL support to Zotero is presented that also works in newer versions of Firefox.
The procedure is similar to the previous post with one difference: This time, you modify the Zotero plugin before installing it in Firefox.

mkdir ~/work
cd ~/work
wget http://download.zotero.org/extension/zotero-2.1.10.xpi
unzip -d xpi zotero-2.1.10.xpi
mkdir jar
cd jar
jar -xf ../xpi/chrome/zotero.jar
cd ..
wget http://downloads.sourceforge.net/project/tinymce/TinyMCE/
unzip tinymce_3_3_9_2.zip
cp -au tinymce/jscripts/tiny_mce/* jar/content/zotero/tinymce/
sed -i 's/paste,contextmenu/paste,contextmenu,directionality/g' jar/content/zotero/tinymce/note.html
sed -i 's/sup,|,forecolor/sup,|,ltr,rtl,|,forecolor/g' jar/content/zotero/tinymce/note.html
cd jar
jar -c0f ../xpi/chrome/zotero.jar *
cd ../xpi
zip -r ../zotero-2.1.10-rtl.xpi *

The above procedure worked for me on Zotero 2.1.10 and Firefox 9.0.1.
The version of TinyMCE that should be downloaded can be determined by inspecting the file jar/content/zotero/tinymce/tiny_mce.js before downloading it.



  1. Thanks a lot for this post.
    I’ve tried it and it works fine using firefox. However, I prefer using the standalone version of zotero together with chrome. Is it possible to do the same for the standalone version?

    Thank you

    Comment by Adam — January 30, 2012 @ 9:29 am | Reply

    • I did not try this on the standalone version. But you may give it a try. Just replace the chrome/zotero.jar with the one you built according to this post. I’d be glad to hear from you about the result.

      Comment by fadishei — February 2, 2012 @ 6:19 am | Reply

      • I tried it, hopefully the right way, but to no avail. Do you have any idea how to solve this?

        Comment by Adam — February 4, 2012 @ 4:44 pm

      • Hello. It’s a late reply but I hope it helps.
        Didn’t you get any error messages during the procedure?
        I tested the procedure for Zotero Standalone 3.0.3 and it worked. What I did was very similar to the method in my blog post: I enabled the directionality plugin in the TinyMCE inside chrome/zotero.jar. These are the steps that I followed:

        $ mkdir -p ~/work/zotero
        $ cd ~/work/zotero
        $ jar -xf ~/Zotero_linux-i686/chrome/zotero.jar
        $ 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/
        $ 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”,

        $ jar -c0f zotero.jar *
        $ mv zotero.jar ~/Zotero_linux-i686/chrome/

        Comment by fadishei — March 26, 2012 @ 3:25 pm

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: