X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1a8e309166de13278b719b3dd8b9db73d4750bb2..0d91b2342a1f83b3b9db145c7210efd5d9547cc8:/src/common/intl.cpp?ds=sidebyside diff --git a/src/common/intl.cpp b/src/common/intl.cpp index a5e863883e..ad84ce7ba4 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1583,11 +1583,13 @@ bool wxLocale::Init(const wxChar *szName, // there may be a catalog with toolkit specific overrides, it is not // an error if this does not exist - if ( bOk && wxTheApp ) + if ( bOk ) { - wxAppTraits *traits = wxTheApp->GetTraits(); - if (traits) - AddCatalog(traits->GetToolkitInfo().name.BeforeFirst(wxT('/')).MakeLower()); + wxString port(wxPlatformInfo().GetPortIdName()); + if ( !port.empty() ) + { + AddCatalog(port.BeforeFirst(wxT('/')).MakeLower()); + } } } @@ -2449,9 +2451,10 @@ wxFontEncoding wxLocale::GetSystemEncoding() wxFontEncoding enc = wxFontMapperBase::GetEncodingFromName(encname); // on some modern Linux systems (RedHat 8) the default system locale - // is UTF8 -- but it isn't supported by wxGTK in ANSI build at all so + // is UTF8 -- but it isn't supported by wxGTK1 in ANSI build at all so // don't even try to use it in this case -#if !wxUSE_UNICODE && (defined(__WXGTK__) || defined(__WXMOTIF__)) +#if !wxUSE_UNICODE && \ + ((defined(__WXGTK__) && !defined(__WXGTK20__)) || defined(__WXMOTIF__)) if ( enc == wxFONTENCODING_UTF8 ) { // the most similar supported encoding...