Provide both forms of wxLocale::Init to wxPython

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19317 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-02-26 03:56:38 +00:00
parent 22b115a7ff
commit 25f8fb989c

View File

@@ -724,18 +724,27 @@ public:
wxLocale(int language = wxLANGUAGE_DEFAULT,
int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING);
bool Init(const wxString& szName,
const wxString& szShort = wxPyEmptyString,
const wxString& szLocale = wxPyEmptyString,
bool bLoadDefault = TRUE,
bool bConvertEncoding = FALSE);
%name(InitLang) bool Init(int language = wxLANGUAGE_DEFAULT,
int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING);
// restores old locale
~wxLocale();
%name(Init1)bool Init(const wxString& szName,
const wxString& szShort = wxPyEmptyString,
const wxString& szLocale = wxPyEmptyString,
bool bLoadDefault = TRUE,
bool bConvertEncoding = FALSE);
%name(Init2) bool Init(int language = wxLANGUAGE_DEFAULT,
int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING);
%pragma(python) addtoclass = "
def Init(self, *_args, **_kwargs):
if type(_args[0]) in [type(''), type(u'')]:
val = apply(self.Init1, _args, _kwargs)
else:
val = apply(self.Init2, _args, _kwargs)
return val
"
// Try to get user's (or OS's) prefered language setting.
// Return wxLANGUAGE_UNKNOWN if language-guessing algorithm failed