]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/intl.cpp
Use gtk_init_check instead of gtk_init so that we can racefully exit
[wxWidgets.git] / src / common / intl.cpp
index ecb0166cff09e58f6ddc9e500bf39985f9cb0c8c..117860d71e3a6bbcb49c202088180f7e998ef606 100644 (file)
     #pragma option -O1
 #endif
 
+#ifdef __EMX__
+// The following define is needed by Innotek's libc to
+// make the definition of struct localeconv available.
+#define __INTERNAL_DEFS
+#endif
+
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -1370,7 +1376,7 @@ wxLanguageInfoArray *wxLocale::ms_languagesDB = NULL;
 }
 
 
-wxLocale::wxLocale()
+void wxLocale::DoCommonInit()
 {
   m_pszOldLocale = NULL;
   m_pMsgCat = NULL;
@@ -1418,9 +1424,11 @@ bool wxLocale::Init(const wxChar *szName,
   // TODO: how to find languageId
   // SetLocaleInfo(languageId, SORT_DEFAULT, localeName);
 #else
-  m_pszOldLocale = wxSetlocale(LC_ALL, szLocale);
-  if ( m_pszOldLocale )
-      m_pszOldLocale = wxStrdup(m_pszOldLocale);
+  wxMB2WXbuf oldLocale = wxSetlocale(LC_ALL, szLocale);
+  if ( oldLocale )
+      m_pszOldLocale = wxStrdup(oldLocale);
+  else
+      m_pszOldLocale = NULL;
 #endif
 
   if ( m_pszOldLocale == NULL )
@@ -2510,7 +2518,7 @@ bool wxLocale::AddCatalog(const wxChar *szDomain)
 #ifdef __WXMSW__
 
 /* static */
-wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat)
+wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat))
 {
     wxString str;
     wxChar buffer[256];
@@ -2559,9 +2567,11 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat)
             switch (index)
             {
                 case wxLOCALE_THOUSANDS_SEP:
-                    return locale_info->thousands_sep;
+                    return wxString(locale_info->thousands_sep,
+                                    *wxConvCurrent);
                 case wxLOCALE_DECIMAL_POINT:
-                    return locale_info->decimal_point;
+                    return wxString(locale_info->decimal_point,
+                                    *wxConvCurrent);
                 default:
                     return wxEmptyString;
             }
@@ -2569,9 +2579,11 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat)
             switch (index)
             {
                 case wxLOCALE_THOUSANDS_SEP:
-                    return locale_info->mon_thousands_sep;
+                    return wxString(locale_info->mon_thousands_sep,
+                                    *wxConvCurrent);
                 case wxLOCALE_DECIMAL_POINT:
-                    return locale_info->mon_decimal_point;
+                    return wxString(locale_info->mon_decimal_point,
+                                    *wxConvCurrent);
                 default:
                     return wxEmptyString;
             }
@@ -3177,7 +3189,7 @@ void wxLocale::InitLanguagesDB()
    LNG(wxLANGUAGE_BURMESE,                    "my"   , 0              , 0                                 , "Burmese")
    LNG(wxLANGUAGE_CAMBODIAN,                  "km"   , 0              , 0                                 , "Cambodian")
    LNG(wxLANGUAGE_CATALAN,                    "ca_ES", LANG_CATALAN   , SUBLANG_DEFAULT                   , "Catalan")
-   LNG(wxLANGUAGE_CHINESE,                    "zh_CN", LANG_CHINESE   , SUBLANG_DEFAULT                   , "Chinese")
+   LNG(wxLANGUAGE_CHINESE,                    "zh_TW", LANG_CHINESE   , SUBLANG_DEFAULT                   , "Chinese")
    LNG(wxLANGUAGE_CHINESE_SIMPLIFIED,         "zh_CN", LANG_CHINESE   , SUBLANG_CHINESE_SIMPLIFIED        , "Chinese (Simplified)")
    LNG(wxLANGUAGE_CHINESE_TRADITIONAL,        "zh_TW", LANG_CHINESE   , SUBLANG_CHINESE_TRADITIONAL       , "Chinese (Traditional)")
    LNG(wxLANGUAGE_CHINESE_HONGKONG,           "zh_HK", LANG_CHINESE   , SUBLANG_CHINESE_HONGKONG          , "Chinese (Hongkong)")