Monday, August 23, 2010

More RTL Python Editor

Last time I tried to introduce the idea of an RTL Python editor for RTL languages like Arabic, Persian, Urdu, and Hebrew.

The idea is a little further along.  I've gotten some Arabic and Urdu fonts installed.  Also, the editor is capable of handling dictionaries, lists, tuples, and classes (there is code for brace type characters and an Arabic comma).

Here is a screenshot for a function that is all in Arabic except for the Python keywords (apologies to the Arabic speaking readership - the words are probably nonsense, as I just cut and pasted them randomly from the Python wiki's Arabic page):

The editor is written in Java.  I'm working on writing the transfer to and from interpretable Python code in jython.

The approach I've taken is, if not a brute force one, definitely a forced one.  Trying to mix and match left to right with bidirectional and right to left is tricky.  To get around this I treat everything between whitespace and special characters (braces, colons, periods) as individual pieces of text.   I further separate the text from whitespace and special characters through the use of the non-spacing, invisible Unicode character 200e.  That character forces the editor back into left to right mode between words.  Time will tell if this was a viable design decision.

For now it's one more step away from vaporware and towards releasable open source software.