wxLocale, searching for message catalogs

Hi,
It seems, that wxLocale does not search in standart message catalogs on Linux.
Fragment of my code:

default_locale = locale.getdefaultlocale()[0]
L = wxLocale()
L.Init(default_locale, bConvertEncoding=true)
res = L.AddCatalog('wxmm')
_ = wxGetTranslation

can't find wxmm.mo in /usr/share/locale/<lang>/LC_MESSAGES/, but it is there.
Even if I say

L.Init('ru', bConvertEncoding=true)

and wxmm.mo is in /usr/share/locale/ru/LC_MESSAGES/
result is the same, i.e. 'res' is FALSE

code that works is:

default_locale = locale.getdefaultlocale()[0]
language_definition = default_locale[:2]
L = wxLocale()
L.Init(default_locale, bConvertEncoding=true)
wxLocale_AddCatalogLookupPathPrefix('/usr/share/locale/' + language_definition)
L.AddCatalog('wxmm')
_ = wxGetTranslation

but I want to know where is my mistake if it presents and why it can't find *.mo files as explaned above (first fragment)?

Thanks,
Aleksej Kolga

Aleksej Kolga wrote:

L.Init('ru', bConvertEncoding=true)

You have to either set all first 3 parameters
(szName,szShort,szLocale) or (much better) use Init2 with
wxLANGUAGE_DEFAULT.

HTH
VS

···

--
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x465264C9

Vaclav Slavik пишет:

Aleksej Kolga wrote:

L.Init('ru', bConvertEncoding=true)
   
You have to either set all first 3 parameters (szName,szShort,szLocale) or (much better) use Init2 with wxLANGUAGE_DEFAULT.

HTH
VS

Yes, you are right

wxLocale(wxLANGUAGE_DEFAULT)

works fine.

Thank you.