Update of /cvsroot/mahogany/M/src/gui
In directory usw-pr-cvs1:/tmp/cvs-serv18305/src/gui

Modified Files:
        wxMApp.cpp 
Log Message:
don't translate anything if the system language is English

Index: wxMApp.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMApp.cpp,v
retrieving revision 1.245
retrieving revision 1.246
diff -b -u -2 -r1.245 -r1.246
--- wxMApp.cpp  7 Sep 2002 20:55:34 -0000       1.245
+++ wxMApp.cpp  7 Sep 2002 22:49:32 -0000       1.246
@@ -753,19 +753,58 @@
         failedToSetLocale = false;
 
-   if ( !locale.empty() )
+   // user may explicitly disable i18n by giving --lang=none switch
+   if ( locale != "none" )
    {
       // TODO should catch the error messages and save them for later
       wxLogNull noLog;
 
+      wxString nameShort,
+               nameLong;
+
       if ( locale.empty() )
       {
          // use the default system language
-         m_Locale = new wxLocale(wxLANGUAGE_DEFAULT);
+         int lang = wxLocale::GetSystemLanguage();
+         switch ( lang )
+         {
+            case wxLANGUAGE_ENGLISH:
+            case wxLANGUAGE_ENGLISH_UK:
+            case wxLANGUAGE_ENGLISH_US:
+            case wxLANGUAGE_ENGLISH_AUSTRALIA:
+            case wxLANGUAGE_ENGLISH_BELIZE:
+            case wxLANGUAGE_ENGLISH_BOTSWANA:
+            case wxLANGUAGE_ENGLISH_CANADA:
+            case wxLANGUAGE_ENGLISH_CARIBBEAN:
+            case wxLANGUAGE_ENGLISH_DENMARK:
+            case wxLANGUAGE_ENGLISH_EIRE:
+            case wxLANGUAGE_ENGLISH_JAMAICA:
+            case wxLANGUAGE_ENGLISH_NEW_ZEALAND:
+            case wxLANGUAGE_ENGLISH_PHILIPPINES:
+            case wxLANGUAGE_ENGLISH_SOUTH_AFRICA:
+            case wxLANGUAGE_ENGLISH_TRINIDAD:
+            case wxLANGUAGE_ENGLISH_ZIMBABWE:
+               // nothing to do -- we don't have to translate the messages from
+               // English to English
+               break;
+
+            case wxLANGUAGE_UNKNOWN:
+               // ignore silently for now, what can we do, anyhow?
+               break;
+
+            default:
+               const wxLanguageInfo *info = wxLocale::GetLanguageInfo(lang);
+               nameLong = info->Description;
+               nameShort = info->CanonicalName;
+         }
       }
-      else if ( locale != "none" )
+      else // we have locale
       {
-         m_Locale = new wxLocale(locale, locale, NULL);
+         nameLong =
+         nameShort = locale;
       }
-      //else: user explicitly disabled i18n
+
+      if ( !nameShort.empty() )
+      {
+         m_Locale = new wxLocale(nameShort, nameLong);
 
       if ( !m_Locale->IsOk() )
@@ -807,4 +846,5 @@
 
             failedToLoadMsgs = true;
+            }
          }
       }



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to