Skip to content

@brunoeagle /wxhe_language.cpp
Last active

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
wxHexEditor language setter
void wxHexEditorApp::SetLanguage(void){
//wxString lang = wxConfigBase::Get()->Read( _T("Language"), wxEmptyString );^M
int sysLanguage = wxLocale::GetSystemLanguage();
/*if ( lang.IsEmpty() or
wxLocale::FindLanguageInfo( lang ) == NULL ){
lang=wxT("English"); //Defaulting to english.
wxConfigBase::Get()->Write( _T("Language"), _T("English") );
wxConfigBase::Get()->Flush();
}^M*/
//int langid = wxLocale::FindLanguageInfo( lang )->Language;
//if ( !myLocale.Init( langid ) ){
if ( !myLocale.Init( sysLanguage ) ) { // try to set the default system language
if ( !myLocale.Init( wxLANGUAGE_ENGLISH ) ) { // if fail, try english
return;
}
}
wxFileName flnm(argv[0]); //take current path and search "locale" directory^M
myLocale.AddCatalogLookupPathPrefix( flnm.GetPath(wxPATH_GET_SEPARATOR) + _T("locale") );
//#ifdef _UNIX_^M
// myLocale.AddCatalogLookupPathPrefix( _T("/usr/local/share/locale/") );^M
//#endif^M
#ifdef __WXMAC__
myLocale.AddCatalogLookupPathPrefix( flnm.GetPath(wxPATH_GET_SEPARATOR) + _T("..") + wxFileName::GetPathSeparator() + _T("Resources") + wxFileName::GetPathSeparator() + _T("locale") );
#endif
myLocale.AddCatalog(_T("wxHexEditor"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.