A few RTL questions

Frank Niessink frank at niessink.com
Sat Dec 8 10:49:43 PST 2007


Hi,

One of Task Coach's users has been so kind to produce a Hebrew
translation, so now I'm trying to support Hebrew, which is the first
Right-to-Left (RTL) language for Task Coach. BTW, Task Coach is
developed using Python/wxPython 2.8. I tested the issues below on
Windows Vista with wxPython 2.8.6.1.

Mostly, I'm glad to say, it just works. I'm setting the locale to
he_IL and the whole application is displayed RTL, see attached
screenshot.

Unfortunately, all bitmaps are flipped horizontally as well. For the
toolbar bitmaps and the bitmaps in the list/tree controls, that's no
big problem, but the bitmap used for the splashscreen is flipped too.
However, that bitmap is not internationalized so flipping it
horizontally is not what I want. I tried calling
self.GetSplashWindow().SetLayoutDirection(wx.Layout_LeftToRight) and
then self.Layout(), where self is a wx.SplashCreen instance, but that
first shows the bitmap mirrored and then after a second or so in the
original direction.

TextCtrl's have another issue. Text controls automatically (at least
on Windows Vista) show a right-click menu that allows one to change
the text direction and intermix RTL and LTR text. However, these menu
items disappear from the right-click menu (the menu options
Undo/Redo/Cut/Copy/Paste are still there) as soon as I use the
wx.TE_RICH style that I need for clickable URL's. How can I have my
cake and eat it too?

To program some workarounds (e.g. programmatically flipping the bitmap
as soon as the language is RTL) I wanted to ask the locale whether the
current language is RTL. However, I cannot seem to find how to do
that. Does the locale know which languages are RTL?

Thanks, Frank
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Task Coach in Hebrew.png
Type: image/png
Size: 94590 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wx-users/attachments/20071208/0d=
746657/TaskCoachinHebrew.png


More information about the wx-users mailing list