]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/intl.cpp
added support for async playback to Unix implementation of wxSound, implemented SDL...
[wxWidgets.git] / src / common / intl.cpp
index bddfe17c34da94d31da0c83e7020a946803a2b82..74aae5cae4d11d37d6884305bd4f27ef61df1860 100644 (file)
     #pragma implementation "intl.h"
 #endif
 
+#if defined(__BORLAND__) && !defined(__WXDEBUG__)
+    // There's a bug in Borland's compiler that breaks wxLocale with -O2,
+    // so make sure that flag is not used for this file:
+    #pragma option -O1
+#endif
+
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -1215,7 +1221,7 @@ void wxMsgCatalogFile::FillHash(wxMessagesHash& hash, bool convertEncoding) cons
     if ( convertEncoding )
     {
         wxFontEncoding targetEnc = wxFONTENCODING_SYSTEM;
-        wxFontEncoding enc = wxFontMapper::Get()->CharsetToEncoding(charset, FALSE);
+        wxFontEncoding enc = wxFontMapper::Get()->CharsetToEncoding(m_charset, FALSE);
         if ( enc == wxFONTENCODING_SYSTEM )
         {
             convertEncoding = FALSE; // unknown encoding
@@ -2238,6 +2244,8 @@ wxFontEncoding wxLocale::GetSystemEncoding()
     {
         return wxFONTENCODING_CP950;
     }
+#elif defined(__WXMAC__)
+    return wxMacGetFontEncFromSystemEnc( CFStringGetSystemEncoding() ) ;
 #elif defined(__UNIX_LIKE__) && wxUSE_FONTMAP
     wxString encname = GetSystemEncodingName();
     if ( !encname.empty() )
@@ -2421,14 +2429,14 @@ const wxChar *wxLocale::GetString(const wxChar *szOrigString,
             {
                 wxLogTrace(_T("i18n"),
                            _T("string '%s'[%d] not found in domain '%s' for locale '%s'."),
-                           szOrigString, n, szDomain, m_strLocale.c_str());
+                           szOrigString, (int)n, szDomain, m_strLocale.c_str());
 
             }
             else
             {
                 wxLogTrace(_T("i18n"),
                            _T("string '%s'[%d] not found in locale '%s'."),
-                           szOrigString, n, m_strLocale.c_str());
+                           szOrigString, (int)n, m_strLocale.c_str());
             }
         }
 #endif // __WXDEBUG__
@@ -2479,6 +2487,11 @@ bool wxLocale::AddCatalog(const wxChar *szDomain)
     // don't add it because it couldn't be loaded anyway
     delete pMsgCat;
 
+    // it's OK to not load English catalog, the texts are embedded in
+    // the program:
+    if (m_strShort.Mid(0, 2) == wxT("en"))
+        return TRUE;
+
     return FALSE;
   }
 }