Adding a new locale

Hello list,

I have translated wxWidgets into Brazilian Portuguese; tested it with
msgfmt and it found no errors.

However, I'm failing in applying the catalog file to wxWidgets as I
couldn't find a way to make wxPython use this translations -- I
created a wxMDIWindow for testing purposes, tried to use setlocale but
the "Window" menu (and its options like "Tile Horizontally",
"Vertically", etc.) still appear in English. I also tried some
googling but I couldn't find some recipe to add a entirely new
language to wxWidgets/wxPython.

Could you point me some links on how should I start? I'm on a WinXP,
wxPython 2.4.2.4, Python 2.2.2.

Thanks in advance.

-- tacao

[sorry for replying my own post]

In Wednesday, May 12, 2004, 6:33:14 PM, /me wrote:

I have translated wxWidgets into Brazilian Portuguese; tested it with
msgfmt and it found no errors.

However, I'm failing in applying the catalog file to wxWidgets as I
couldn't find a way to make wxPython use this translations -- I
created a wxMDIWindow for testing purposes, tried to use setlocale but
the "Window" menu (and its options like "Tile Horizontally",
"Vertically", etc.) still appear in English. I also tried some
googling but I couldn't find some recipe to add a entirely new
language to wxWidgets/wxPython.

Could you point me some links on how should I start? I'm on a WinXP,
wxPython 2.4.2.4, Python 2.2.2.

Ok, here's what I did and it seems to be working now:

- created a "pt_BR\LC_MESSAGES\" folder under
"...\site-packages\wxPython\locale\" and put my pt_BR wxstd.mo file
inside it;

- put this in the top of my app:

import locale

- and put this in the top of my OnInit method:

class MyApp(wxApp):
    def OnInit(self):
        self.locale = wxLocale(wxLANGUAGE_PORTUGUESE_BRAZILIAN)
        locale.setlocale(locale.LC_ALL, '')

-- tacao