i18n under Windows?

Hi friends,

I have setup i18n routine in my app. On Linux it's works, as it should to work. But on Windows 2000 SP I caught following bug (see screenshot).

Here the code, that raise this bug:

     # set up internatiolization
     global _wxloc
     wx.Locale_AddCatalogLookupPathPrefix(locations['locale'])
     _wxloc = wx.Locale(wx.LANGUAGE_DEFAULT) # Seems error was appear on
     _wxloc.AddCatalog('bbcalc') # this two line???
     import __builtin__
     setattr(__builtin__, '_', wx.GetTranslation)

locations['locale'] is a os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'i18n'))

PS. wxPython 2.8.0.1

screenshot.png

Basil Shubin wrote:

Hi friends,

I have setup i18n routine in my app. On Linux it's works, as it should to work. But on Windows 2000 SP I caught following bug (see screenshot).

You need to create your wx.App object before you can create the wx.Locale object.

···

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

Hi Basil,

Basil Shubin wrote:

Hi friends,

I have setup i18n routine in my app. On Linux it's works, as it should to work. But on Windows 2000 SP I caught following bug (see screenshot).

Here the code, that raise this bug:

    # set up internatiolization
    global _wxloc
    wx.Locale_AddCatalogLookupPathPrefix(locations['locale'])
    _wxloc = wx.Locale(wx.LANGUAGE_DEFAULT) # Seems error was appear on
    _wxloc.AddCatalog('bbcalc') # this two line???
    import __builtin__
    setattr(__builtin__, '_', wx.GetTranslation)

locations['locale'] is a os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'i18n'))

What if you change it to:
wx.Locale.AddCatalogLookupPathPrefix(locations['locale'])

Note the full stop after wx.Locale.

You might want to have a look at the I18n module in the wxPython demo (as of 2.8).

Werner

Robin Dunn wrote:

Basil Shubin wrote:

Hi friends,

I have setup i18n routine in my app. On Linux it's works, as it should to work. But on Windows 2000 SP I caught following bug (see screenshot).

You need to create your wx.App object before you can create the wx.Locale object.

That's it! After I have move i18n routine in to OnInit method of wx.App subclass everything starts working on Windows!

Thanks!

Hallo Werner,

Werner F. Bruhin wrote:

Hi Basil,

Basil Shubin wrote:

Hi friends,

I have setup i18n routine in my app. On Linux it's works, as it should to work. But on Windows 2000 SP I caught following bug (see screenshot).

Here the code, that raise this bug:

    # set up internatiolization
    global _wxloc
    wx.Locale_AddCatalogLookupPathPrefix(locations['locale'])
    _wxloc = wx.Locale(wx.LANGUAGE_DEFAULT) # Seems error was appear on
    _wxloc.AddCatalog('bbcalc') # this two line???
    import __builtin__
    setattr(__builtin__, '_', wx.GetTranslation)

locations['locale'] is a os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'i18n'))

What if you change it to:
wx.Locale.AddCatalogLookupPathPrefix(locations['locale'])

Note the full stop after wx.Locale.

No matter if there a stop ot underline. It starts working only after I has move all i18n initilize routine into OnInit method of wx.App subclass.

Danke!

Robin Dunn wrote:

Basil Shubin wrote:

Hi friends,

I have setup i18n routine in my app. On Linux it's works, as it should to work. But on Windows 2000 SP I caught following bug (see screenshot).

You need to create your wx.App object before you can create the wx.Locale object.

Is it an innovation of 2.8 branch? I am not too sure, but is it differ from 2.6?

Basil Shubin wrote:

Robin Dunn wrote:

Basil Shubin wrote:

Hi friends,

I have setup i18n routine in my app. On Linux it's works, as it should to work. But on Windows 2000 SP I caught following bug (see screenshot).

You need to create your wx.App object before you can create the wx.Locale object.

Is it an innovation of 2.8 branch? I am not too sure, but is it differ from 2.6?

I don't remember for sure in this case, but it is possible. There were a number of internal things changed that could have an effect like this.

···

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

Basil Shubin wrote:

What if you change it to:
wx.Locale.AddCatalogLookupPathPrefix(locations['locale'])

Note the full stop after wx.Locale.

No matter if there a stop ot underline. It starts working only after I has move all i18n initilize routine into OnInit method of wx.App subclass.

They are basically the same thing. One is a standalone function and one is a static method, but they both call the same C++ function.

···

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