Hi,
[snip]
>>>
>>> loc = wx.wxLocale(wx.wxLANGUAGE_TURKISH)
>>>
>>> print(loc:GetString("&About")) --not translated
>>> print(loc:GetString("&About", "wxstd")) --translated
>>>
>>> print(wx.wxGetTranslation("&About")) --not translated
>>> print(wx.wxGetTranslation("&About", "wxstd")) --translated
>>>
> [snip]
>
> I think I found the reason of requiring szDomain parameter to translate..
>
> [intl.h]
> virtual const wxChar *
> GetString(const wxChar *szOrigString,
> const wxChar *szDomain = NULL) const;
>
> virtual const wxChar *
> GetString(const wxChar *szOrigString,
> const wxChar *szOrigString2,
> size_t n,
> const wxChar *szDomain = NULL) const;
>
> szDomain is declared as wxChar here, and:
>
> [intl.cpp ~2608]
> it is checked against NULL
>
>
> but in [wxLua - datetime.cpp ~5733] it is declared and used as wxString:
> //virtual wxString
> //GetString(const wxString& szOrigString,
> // const wxString& szDomain = "") const;
> static int LUACALL wxLua_wxLocale_GetString(lua_State *L)
> ...
> const wxString szDomain = (argCount >= 3 ?
> wxlState.GetwxStringType(3) :
> wxString(wxEmptyString));
> ...
>
> If we omit szDomain parameter, it gets an emty string instead of NULL!
>
I hacked datetime.cpp and wx_bind.cpp to test my thinking; now GetString
and wxGetTranslation works as expected..
[datetime.cpp]
static int LUACALL wxLua_wxLocale_GetString1(lua_State *L)
...
// returns = (self->GetString(szOrigString, szOrigString2, n, szDomain));
returns = (self->GetString(szOrigString, szOrigString2, n,
szDomain.IsEmpty() ? NULL : szDomain.c_str()));
static int LUACALL wxLua_wxLocale_GetString(lua_State *L)
...
// returns = (self->GetString(szOrigString, szDomain));
returns = (self->GetString(szOrigString, szDomain.IsEmpty() ? NULL :
szDomain.c_str()));
[wx_bind.cpp]
static int LUACALL wxLua_function_wxGetTranslation(lua_State *L)
...
// returns = (wxGetTranslation(sz, domain));
returns = (wxGetTranslation(sz, domain.IsEmpty() ? NULL : domain.c_str()));
static int LUACALL wxLua_function_wxGetTranslationPlural(lua_State *L)
...
// returns = (wxGetTranslation(sz1, sz2, n, domain));
returns = (wxGetTranslation(sz1, sz2, n, domain.IsEmpty() ? NULL :
domain.c_str()));
I hope you'll find a real solution...
--
Regards,
Hakki Dogusan
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users