Question on language issues and new-style toolbars

Hi all,

I have some question regarding to language issues. I've almost no knowledge in this aspect so bear with me a little bit. I'm trying to code an application with text in Traditional Chinese (Big5) encoding. I've downloaded the non-unicode version of the wxPython, runs it on Win XP and it displays just fine. I wonder how a Unicode version of wxPython come into play in my situation.

Another more specific question is a lot of ready-made items such as wx.wxPrintPreview and wxWizard all have controls that are in English. Is there a way to change that? Or do I need to dig in and just tweak the code?

A third question is the Python demo doesn't seem to have demos for toolbars. And from playing around with some wxWindows/wxPython app such as storylines and boa constructor, it seems like there isn't a toolbar for the newer IE4.0 style. (Well, I mean the border of the toolbar icon showing up during a mouse-over event). If it doesn't will it eventually does? How about the XP style menus? It is less a usability issue than a psychological issue. I would prefer to have my application look "new".

Thanks,

Timothy

Timothy Wu wrote:

Hi all,

I have some question regarding to language issues. I've almost no knowledge in this aspect so bear with me a little bit. I'm trying to code an application with text in Traditional Chinese (Big5) encoding. I've downloaded the non-unicode version of the wxPython, runs it on Win XP and it displays just fine. I wonder how a Unicode version of wxPython come into play in my situation.

Basically instead of having strings that are "encoded" into the 8-bit range for specific languages, you are able to use unicode (or wide-character) strings in Python and they are passed as such to the Windows API. Wide-character strings do not require encoding since they have a large enough range of values to (theoretically) represent all characters.

Another more specific question is a lot of ready-made items such as wx.wxPrintPreview and wxWizard all have controls that are in English. Is there a way to change that? Or do I need to dig in and just tweak the code?

Translations are provided using gettext style .mo files. You may have to create and Init a wxLocale object to get them to be used inside wxWindows.

A third question is the Python demo doesn't seem to have demos for toolbars.

It does. Look a little harder.

And from playing around with some wxWindows/wxPython app such as storylines and boa constructor, it seems like there isn't a toolbar for the newer IE4.0 style. (Well, I mean the border of the toolbar icon showing up during a mouse-over event).

Try using the wxTB_FLAT style.

If it doesn't will it eventually does? How about the XP style menus? It is less a usability issue than a psychological issue. I would prefer to have my application look "new".

The XP LnF and themes will be used automatically if you have a "manifest" file for the .exe (python in this case.) The wxPython installer should have put a set of manifest files in place for python and pythonw for you. If you make an exe from you Python app then you will want to do the same thing.

Be warned however that microsoft broke a number of things with the themed version of the common controls and not all of them have been worked around in wxWindows yet. If something is behaving strangly try removing the .manifest file and run it again and see if there is a difference.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Timothy Wu wrote:

Hi all,

I have some question regarding to language issues. I've almost no knowledge in this aspect so bear with me a little bit. I'm trying to code an application with text in Traditional Chinese (Big5) encoding. I've downloaded the non-unicode version of the wxPython, runs it on Win XP and it displays just fine. I wonder how a Unicode version of wxPython come into play in my situation.

Basically instead of having strings that are "encoded" into the 8-bit range for specific languages, you are able to use unicode (or wide-character) strings in Python and they are passed as such to the Windows API. Wide-character strings do not require encoding since they have a large enough range of values to (theoretically) represent all characters.

When I used the Unicode version of wxPython to run my original program, text ( on menus, buttons, etc) appears to be in scrambled nonsense. I guess there should be a way to tell the system what encoding I am using so text can be display properly?

Another more specific question is a lot of ready-made items such as wx.wxPrintPreview and wxWizard all have controls that are in English. Is there a way to change that? Or do I need to dig in and just tweak the code?

Translations are provided using gettext style .mo files. You may have to create and Init a wxLocale object to get them to be used inside wxWindows.

From the wxWindows manual distributed with the Windows wxPython binary distribution, inside topic overview/internationalization, it points to gettext and msgfmt. Aren't they all tools working on Unix and for C? (Or do I use Python gettext module and ???) Also from wxPython overview, it seem like neither wxLocale nor wxGetTranslation are wrapped. What's the solution for Windows and Python? (Python locale module?)

Thanks,

Timothy

Timothy Wu wrote:

Robin Dunn wrote:

Basically instead of having strings that are "encoded" into the 8-bit range for specific languages, you are able to use unicode (or wide-character) strings in Python and they are passed as such to the Windows API. Wide-character strings do not require encoding since they have a large enough range of values to (theoretically) represent all characters.

When I used the Unicode version of wxPython to run my original program, text ( on menus, buttons, etc) appears to be in scrambled nonsense.

What platform and version?

I guess there should be a way to tell the system what encoding I am using so text can be display properly?

Not with the Unicode build. That is the thing Unicode was created for, so there wouldn't have to be any encodings anymore. You do have to have Unincode enabled fonts installed though. OTOH, since there are so many possible glyphs in Unicode most fonts don't implement chacharacters for all languages, otherwise the font file could be unmanigably large...

Translations are provided using gettext style .mo files. You may have to create and Init a wxLocale object to get them to be used inside wxWindows.

From the wxWindows manual distributed with the Windows wxPython binary distribution, inside topic overview/internationalization, it points to gettext and msgfmt. Aren't they all tools working on Unix and for C? (Or do I use Python gettext module and ???)

There are DOS versions of the command-line tools available. The Python version of msgfmt should also work. wxWindows has implemented its own version of gettext library functions in order to be able to not be restricted to GPL, but it is compatible with the GNU gettext.

Also from wxPython overview, it seem like neither wxLocale nor wxGetTranslation are wrapped. What's the solution for Windows and Python? (Python locale module?)

They are wrapped, just not mentioned in the docs or demo yet I guess. You may be able to find some samples or info searching the archives of this list. I don't see any examples in the wiki yet...

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!