]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/intl.cpp
Applied patch #886192: "Minor fix to XRC contrib"; Minor cosmetic cleanups.
[wxWidgets.git] / src / common / intl.cpp
index 753dfcb11e65743e4a08bf07963dc5abe8fd8781..0a3c746a53666fd636b187025c55c3b63312a2b8 100644 (file)
@@ -1215,7 +1215,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
@@ -1659,7 +1659,7 @@ bool wxLocale::Init(int language, int flags)
                     (flags & wxLOCALE_CONV_ENCODING) != 0);
     free(szLocale);
 
-    if ( ret )
+    if (IsOk()) // setlocale() succeeded
         m_language = lang;
 
     return ret;
@@ -2238,6 +2238,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() )
@@ -2420,14 +2422,14 @@ const wxChar *wxLocale::GetString(const wxChar *szOrigString,
             if ( szDomain != NULL )
             {
                 wxLogTrace(_T("i18n"),
-                           _T("string '%s'[%d] not found in domain '%s' for locale '%s'."),
+                           _T("string '%s'[%ld] not found in domain '%s' for locale '%s'."),
                            szOrigString, n, szDomain, m_strLocale.c_str());
 
             }
             else
             {
                 wxLogTrace(_T("i18n"),
-                           _T("string '%s'[%d] not found in locale '%s'."),
+                           _T("string '%s'[%ld] not found in locale '%s'."),
                            szOrigString, n, m_strLocale.c_str());
             }
         }
@@ -2479,6 +2481,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;
   }
 }
@@ -3291,7 +3298,7 @@ void wxLocale::InitLanguagesDB()
    LNG(wxLANGUAGE_SWAHILI,                    "sw_KE", LANG_SWAHILI   , SUBLANG_DEFAULT                   , "Swahili")
    LNG(wxLANGUAGE_SWEDISH,                    "sv_SE", LANG_SWEDISH   , SUBLANG_SWEDISH                   , "Swedish")
    LNG(wxLANGUAGE_SWEDISH_FINLAND,            "sv_FI", LANG_SWEDISH   , SUBLANG_SWEDISH_FINLAND           , "Swedish (Finland)")
-   LNG(wxLANGUAGE_TAGALOG,                    "tl"   , 0              , 0                                 , "Tagalog")
+   LNG(wxLANGUAGE_TAGALOG,                    "tl_PH", 0              , 0                                 , "Tagalog")
    LNG(wxLANGUAGE_TAJIK,                      "tg"   , 0              , 0                                 , "Tajik")
    LNG(wxLANGUAGE_TAMIL,                      "ta"   , LANG_TAMIL     , SUBLANG_DEFAULT                   , "Tamil")
    LNG(wxLANGUAGE_TATAR,                      "tt"   , LANG_TATAR     , SUBLANG_DEFAULT                   , "Tatar")