Hi,
Task Coach (http://www.taskcoach.org, developed using python and
wxPython) comes with different translations, some of which are RTL.
When the user selects Hebrew, the GUI is correctly switched to RTL as
well. However, when selecting Farsi, the GUI is not switched.
The locale is set as follows:
def _setLocale(self, *localeStrings):
for localeString in localeStrings:
languageInfo = wx.Locale.FindLanguageInfo(localeString)
if languageInfo:
self.__locale = wx.Locale(languageInfo.Language)
break
This method takes multiple localeStrings, because Task Coach first
tries the long form (e.g. "fa_IR") and then the short form ("fa") in
case the first didn't succeed.
So, my first question is: why does this work for Hebrew ("he_IL"), but
not for Farsi ("fa_IR")?
The second question is: can I work around this by explicitly setting
the layout direction? I know how to get the current layout direction:
def currentLanguageIsRightToLeft():
return wx.GetApp().GetLayoutDirection() == wx.Layout_RightToLeft
and I know I can set the layout direction of individual windows:
window.SetLayoutDirection(wx.Layout_RightToLeft))
But doing this for every window including dialogs is a bit intrusive
for a work around.
Thanks, Frank