[wxPython-users] Re: wxWizard, several question
Robin Dunn
robin at alldunn.com
Sat Aug 12 15:15:04 PDT 2006
Franz Steinhäusler wrote:
>
> Robin, it makes no difference. I works after applying the sample below for BOTH cases.
>
> Verifying it with wiki (and taking this sample as base and changed a little bit),
> I saw, I have to initialize the gettext system.
>
> There are this two possibilities:
> 1) use wxWidgets gettext system
Ah, yes. I forgot to mention that the wx.Locale needs to be created.
This is how wxWidgets gets its strings from its message catalog.
> localedir = os.path.join(wx.__path__[0], "locale")
> # Set locale for wxWidgets
> mylocale = wx.Locale(langid)
> mylocale.AddCatalogLookupPathPrefix(localedir)
This shouldn't be necessary on Windows, this path is added when wx is
imported. On the other platforms the standard locations for message
catalogs are searched automatically as well.
> mylocale.AddCatalog(domain)
Nor this. The 'wxstd' catalog is already searched for.
PyShell 0.9.5 - The Flakiest Python Shell
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> wx.VERSION
(2, 6, 3, 3, '')
>>> lc = wx.Locale(wx.LANGUAGE_FRENCH)
>>> wx.GetTranslation('&Next')
u'&Suivant'
>>>
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list