[mapguide-commits] r1286 - in trunk/MgDev: Common/Foundation/Exception Common/Foundation/System Common/MapGuideCommon/System Server/src/Common/Base Server/src/Common/Manager Server/src/Core Server/src/Services/Mapping Server/src/UnitTesting Web/src/WebSupport

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Mar 19 13:25:35 EDT 2007


Author: brucedechant
Date: 2007-03-19 13:25:35 -0400 (Mon, 19 Mar 2007)
New Revision: 1286

Modified:
   trunk/MgDev/Common/Foundation/Exception/Exception.cpp
   trunk/MgDev/Common/Foundation/System/FoundationConfigProperties.cpp
   trunk/MgDev/Common/Foundation/System/FoundationConfigProperties.h
   trunk/MgDev/Common/Foundation/System/Resources.cpp
   trunk/MgDev/Common/Foundation/System/Resources.h
   trunk/MgDev/Common/Foundation/System/Util.cpp
   trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp
   trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.h
   trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp
   trunk/MgDev/Server/src/Common/Base/ClientHandler.cpp
   trunk/MgDev/Server/src/Common/Base/ServiceOperation.cpp
   trunk/MgDev/Server/src/Common/Manager/LoadBalanceManager.cpp
   trunk/MgDev/Server/src/Common/Manager/LogThread.cpp
   trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp
   trunk/MgDev/Server/src/Common/Manager/ServerManager.h
   trunk/MgDev/Server/src/Common/Manager/WorkerThread.cpp
   trunk/MgDev/Server/src/Core/OperationThread.cpp
   trunk/MgDev/Server/src/Core/Server.cpp
   trunk/MgDev/Server/src/Core/TimedEventHandler.cpp
   trunk/MgDev/Server/src/Core/main.cpp
   trunk/MgDev/Server/src/Core/serverconfig.ini
   trunk/MgDev/Server/src/Services/Mapping/StylizationUtil.cpp
   trunk/MgDev/Server/src/UnitTesting/TestServerManager.cpp
   trunk/MgDev/Server/src/UnitTesting/TestServerManager.h
   trunk/MgDev/Web/src/WebSupport/InitializeWebTier.cpp
Log:
Implement RFC 18 - Localization (MapGuideRfc18)


Modified: trunk/MgDev/Common/Foundation/Exception/Exception.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/Exception/Exception.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Common/Foundation/Exception/Exception.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -102,16 +102,16 @@
         {
             configuration->GetStringValue(
                 MgFoundationConfigProperties::GeneralPropertiesSection,
-                MgFoundationConfigProperties::GeneralPropertyDefaultLocale,
+                MgFoundationConfigProperties::GeneralPropertyDefaultMessageLocale,
                 locale,
-                MgFoundationConfigProperties::DefaultGeneralPropertyDefaultLocale);
+                MgFoundationConfigProperties::DefaultGeneralPropertyDefaultMessageLocale);
         }
 
         MG_CATCH_AND_RELEASE()
 
         if (locale.empty())
         {
-            locale = MgResources::DefaultLocale;
+            locale = MgResources::DefaultMessageLocale;
         }
     }
 
@@ -267,12 +267,12 @@
 
     MG_CATCH_AND_RELEASE()
 
-    if (message.empty() && NULL != resources && locale != MgResources::DefaultLocale)
+    if (message.empty() && NULL != resources && locale != MgResources::DefaultMessageLocale)
     {
         MG_TRY()
 
         // try using the default locale as a backup
-        STRING resourceStr = resources->GetStringResource(MgResources::DefaultLocale, section,
+        STRING resourceStr = resources->GetStringResource(MgResources::DefaultMessageLocale, section,
             resourceId);
 
         message = resources->FormatMessage(resourceStr, arguments);

Modified: trunk/MgDev/Common/Foundation/System/FoundationConfigProperties.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/FoundationConfigProperties.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Common/Foundation/System/FoundationConfigProperties.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -45,8 +45,10 @@
 // General Properties
 // ******************************************************************
 const STRING MgFoundationConfigProperties::GeneralPropertiesSection                                   = L"GeneralProperties";
-const STRING MgFoundationConfigProperties::GeneralPropertyDefaultLocale                               = L"DefaultLocale";
-const STRING MgFoundationConfigProperties::DefaultGeneralPropertyDefaultLocale                        = L"en";      // ISO 639-1 name
+const STRING MgFoundationConfigProperties::GeneralPropertyLocale                                      = L"Locale";
+const STRING MgFoundationConfigProperties::DefaultGeneralPropertyLocale                               = L"";
+const STRING MgFoundationConfigProperties::GeneralPropertyDefaultMessageLocale                        = L"DefaultMessageLocale";
+const STRING MgFoundationConfigProperties::DefaultGeneralPropertyDefaultMessageLocale                 = L"en";      // ISO 639-1 name
 const STRING MgFoundationConfigProperties::GeneralPropertyResourcesPath                               = L"ResourcesPath";
 const STRING MgFoundationConfigProperties::DefaultGeneralPropertyResourcesPath                        = L"Resources/";
 const STRING MgFoundationConfigProperties::GeneralPropertyTempPath                                    = L"TempPath";
@@ -59,7 +61,8 @@
 ///
 const MgConfigValidationInfo MgFoundationConfigProperties::sm_cviGeneralProperties[] =
 {
-    { MgFoundationConfigProperties::GeneralPropertyDefaultLocale    , MgPropertyType::String    , MG_CONFIG_MIN_LOCALE_LENGTH           , MG_CONFIG_MAX_LOCALE_LENGTH           , L""                                       },
+    { MgFoundationConfigProperties::GeneralPropertyLocale           , MgPropertyType::String    , MG_CONFIG_MIN_OPTIONAL_STRING_LENGTH  , MG_CONFIG_MAX_OPTIONAL_STRING_LENGTH  , L""                                       },
+    { MgFoundationConfigProperties::GeneralPropertyDefaultMessageLocale, MgPropertyType::String , MG_CONFIG_MIN_LOCALE_LENGTH           , MG_CONFIG_MAX_LOCALE_LENGTH           , L""                                       },
     { MgFoundationConfigProperties::GeneralPropertyResourcesPath    , MgPropertyType::String    , MG_CONFIG_MIN_PATH_LENGTH             , MG_CONFIG_MAX_PATH_LENGTH             , MG_CONFIG_PATH_RESERVED_CHARACTERS        },
     { MgFoundationConfigProperties::GeneralPropertyTempPath         , MgPropertyType::String    , MG_CONFIG_MIN_PATH_LENGTH             , MG_CONFIG_MAX_PATH_LENGTH             , MG_CONFIG_PATH_RESERVED_CHARACTERS        },
     { MgFoundationConfigProperties::GeneralPropertyTcpIpMtu         , MgPropertyType::Int32     , 1                                     , 65535                                 , L""                                       },

Modified: trunk/MgDev/Common/Foundation/System/FoundationConfigProperties.h
===================================================================
--- trunk/MgDev/Common/Foundation/System/FoundationConfigProperties.h	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Common/Foundation/System/FoundationConfigProperties.h	2007-03-19 17:25:35 UTC (rev 1286)
@@ -42,10 +42,14 @@
     /// General application properties
     static const STRING GeneralPropertiesSection;                       /// value("GeneralProperties")
 
-    /// Application's default locale
-    static const STRING GeneralPropertyDefaultLocale;                   /// value("DefaultLocale")
-    static const STRING DefaultGeneralPropertyDefaultLocale;            /// value("en")
+    /// Application's locale
+    static const STRING GeneralPropertyLocale;                          /// value("Locale")
+    static const STRING DefaultGeneralPropertyLocale;                   /// value("")
 
+    /// Application's default message locale
+    static const STRING GeneralPropertyDefaultMessageLocale;            /// value("DefaultMessageLocale")
+    static const STRING DefaultGeneralPropertyDefaultMessageLocale;     /// value("en")
+
     /// Root folder for application's localization resources
     static const STRING GeneralPropertyResourcesPath;                   /// value("ResourcesPath")
     static const STRING DefaultGeneralPropertyResourcesPath;            /// value("Resources/")

Modified: trunk/MgDev/Common/Foundation/System/Resources.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/Resources.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Common/Foundation/System/Resources.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -20,7 +20,7 @@
 // Process-wide MgResources
 Ptr<MgResources> MgResources::m_resources = (MgResources*)NULL;
 
-const STRING MgResources::DefaultLocale              = L"en";           // Do not translate (ISO 639-1)
+const STRING MgResources::DefaultMessageLocale       = L"en";           // Do not translate (ISO 639-1)
 const STRING MgResources::ResourceFilenameExtension  = L".res";         // Do not translate
 const STRING MgResources::ResourceFilenameUnderscore = L"_";            // Do not translate
 const STRING MgResources::ResourceComponent          = L"mapguide";     // Do not translate
@@ -547,7 +547,7 @@
 
     MG_RESOURCES_TRY()
 
-    STRING locale = DefaultLocale;
+    STRING locale = DefaultMessageLocale;
     MgConfiguration* configuration = MgConfiguration::GetInstance();
     ACE_ASSERT(NULL != configuration);
 
@@ -555,9 +555,9 @@
     {
         configuration->GetStringValue(
             MgFoundationConfigProperties::GeneralPropertiesSection, 
-            MgFoundationConfigProperties::GeneralPropertyDefaultLocale, 
+            MgFoundationConfigProperties::GeneralPropertyDefaultMessageLocale, 
             locale, 
-            MgFoundationConfigProperties::DefaultGeneralPropertyDefaultLocale);
+            MgFoundationConfigProperties::DefaultGeneralPropertyDefaultMessageLocale);
     }
 
     STRING resourceStr = GetStringResource(locale, section, resourceId);

Modified: trunk/MgDev/Common/Foundation/System/Resources.h
===================================================================
--- trunk/MgDev/Common/Foundation/System/Resources.h	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Common/Foundation/System/Resources.h	2007-03-19 17:25:35 UTC (rev 1286)
@@ -169,7 +169,7 @@
     static const STRING ResourceComponent;
 
     /// Default locale
-    static const STRING DefaultLocale;
+    static const STRING DefaultMessageLocale;
 
     static const STRING ServerServiceName;
     static const STRING ServerServiceDisplayName;

Modified: trunk/MgDev/Common/Foundation/System/Util.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/Util.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Common/Foundation/System/Util.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -763,9 +763,9 @@
 
     configuration->GetStringValue(
         MgFoundationConfigProperties::GeneralPropertiesSection,
-        MgFoundationConfigProperties::GeneralPropertyDefaultLocale,
+        MgFoundationConfigProperties::GeneralPropertyDefaultMessageLocale,
         locale,
-        MgFoundationConfigProperties::DefaultGeneralPropertyDefaultLocale);
+        MgFoundationConfigProperties::DefaultGeneralPropertyDefaultMessageLocale);
     str = resources->GetStringResource(locale, section, messageId);
 
     // If no message is found, we do not fail.

Modified: trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -115,8 +115,10 @@
 const INT32  MgConfigProperties::DefaultGeneralPropertyConnectionTimeout                    = 120;
 const STRING MgConfigProperties::GeneralPropertyConnectionTimerInterval                     = L"ConnectionTimerInterval";
 const INT32  MgConfigProperties::DefaultGeneralPropertyConnectionTimerInterval              = 60;
-const STRING MgConfigProperties::GeneralPropertyDefaultLocale                               = L"DefaultLocale";
-const STRING MgConfigProperties::DefaultGeneralPropertyDefaultLocale                        = L"en";      // ISO 639-1 name
+const STRING MgConfigProperties::GeneralPropertyLocale                                      = L"Locale";
+const STRING MgConfigProperties::DefaultGeneralPropertyLocale                               = L"";
+const STRING MgConfigProperties::GeneralPropertyDefaultMessageLocale                        = L"DefaultMessageLocale";
+const STRING MgConfigProperties::DefaultGeneralPropertyDefaultMessageLocale                 = L"en";      // ISO 639-1 name
 const STRING MgConfigProperties::GeneralPropertyDisplayName                                 = L"DisplayName";
 const STRING MgConfigProperties::DefaultGeneralPropertyDisplayName                          = L"";
 const STRING MgConfigProperties::GeneralPropertyFdoPath                                     = L"FdoPath";
@@ -440,7 +442,8 @@
 {
     { MgConfigProperties::GeneralPropertyConnectionTimeout                          , MgPropertyType::Int32     , MG_CONFIG_MIN_TIMEOUT                 , MG_CONFIG_MAX_TIMEOUT                 , L""                                       },
     { MgConfigProperties::GeneralPropertyConnectionTimerInterval                    , MgPropertyType::Int32     , MG_CONFIG_MIN_TIMER_INTERVAL          , MG_CONFIG_MAX_TIMER_INTERVAL          , L""                                       },
-    { MgConfigProperties::GeneralPropertyDefaultLocale                              , MgPropertyType::String    , MG_CONFIG_MIN_LOCALE_LENGTH           , MG_CONFIG_MAX_LOCALE_LENGTH           , L""                                       },
+    { MgConfigProperties::GeneralPropertyLocale                                     , MgPropertyType::String    , MG_CONFIG_MIN_OPTIONAL_STRING_LENGTH  , MG_CONFIG_MAX_OPTIONAL_STRING_LENGTH  , L""                                       },
+    { MgConfigProperties::GeneralPropertyDefaultMessageLocale                       , MgPropertyType::String    , MG_CONFIG_MIN_LOCALE_LENGTH           , MG_CONFIG_MAX_LOCALE_LENGTH           , L""                                       },
     { MgConfigProperties::GeneralPropertyDisplayName                                , MgPropertyType::String    , MG_CONFIG_MIN_OPTIONAL_STRING_LENGTH  , MG_CONFIG_MAX_OPTIONAL_STRING_LENGTH  , MG_CONFIG_FILE_NAME_RESERVED_CHARACTERS   },
     { MgConfigProperties::GeneralPropertyFdoPath                                    , MgPropertyType::String    , MG_CONFIG_MIN_PATH_LENGTH             , MG_CONFIG_MAX_PATH_LENGTH             , MG_CONFIG_PATH_RESERVED_CHARACTERS        },
     { MgConfigProperties::GeneralPropertyLicenseServerPath                          , MgPropertyType::String    , MG_CONFIG_MIN_OPTIONAL_STRING_LENGTH  , MG_CONFIG_MAX_OPTIONAL_STRING_LENGTH  , L""                                       },

Modified: trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.h	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.h	2007-03-19 17:25:35 UTC (rev 1286)
@@ -54,10 +54,14 @@
     static const STRING GeneralPropertyConnectionTimerInterval;         /// value("ConnectionTimerInterval")
     static const INT32 DefaultGeneralPropertyConnectionTimerInterval;   /// value(60)
 
-    /// Server's default locale
-    static const STRING GeneralPropertyDefaultLocale;                   /// value("DefaultLocale")
-    static const STRING DefaultGeneralPropertyDefaultLocale;            /// value("en")
+    /// Server's locale
+    static const STRING GeneralPropertyLocale;                          /// value("Locale")
+    static const STRING DefaultGeneralPropertyLocale;                   /// value("")
 
+    /// Server's default message locale
+    static const STRING GeneralPropertyDefaultMessageLocale;            /// value("DefaultMessageLocale")
+    static const STRING DefaultGeneralPropertyDefaultMessageLocale;     /// value("en")
+
     /// Server's display name
     static const STRING GeneralPropertyDisplayName;                     /// value("DisplayName")
     static const STRING DefaultGeneralPropertyDisplayName;              /// value("")

Modified: trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -211,7 +211,7 @@
     MgUtil::GenerateUuid(uuid);
 
     // TODO: Pull default locale from MgConfiguration within a try/catch
-    STRING locale = m_locale.empty() ? MgResources::DefaultLocale : m_locale;
+    STRING locale = m_locale.empty() ? MgResources::DefaultMessageLocale : m_locale;
 
     uuid.append(L"_");
     uuid.append(locale);

Modified: trunk/MgDev/Server/src/Common/Base/ClientHandler.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Base/ClientHandler.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/Common/Base/ClientHandler.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -191,9 +191,9 @@
         stream = new MgMapGuideStream( m_pStreamHelper );
 
         // TODO: use locale from client connection
-        mgException->GetMessage(MgResources::DefaultLocale);
-        mgException->GetDetails(MgResources::DefaultLocale);
-        mgException->GetStackTrace(MgResources::DefaultLocale);
+        mgException->GetMessage(MgResources::DefaultMessageLocale);
+        mgException->GetDetails(MgResources::DefaultMessageLocale);
+        mgException->GetStackTrace(MgResources::DefaultMessageLocale);
 
         stream->WriteResponseHeader(MgPacketParser::mecFailure, 1);
         stream->WriteObject(mgException);

Modified: trunk/MgDev/Server/src/Common/Base/ServiceOperation.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Base/ServiceOperation.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/Common/Base/ServiceOperation.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -213,7 +213,7 @@
     if (m_argsRead && NULL != except && m_stream != NULL)
     {
         // Log the exception using Server locale or User locale if it exists
-        STRING locale = MgResources::DefaultLocale;
+        STRING locale = MgResources::DefaultMessageLocale;
         MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
         if (NULL != currUserInfo)
         {
@@ -224,7 +224,7 @@
             MgServerManager* serverManager = MgServerManager::GetInstance();
             if (NULL != serverManager)
             {
-                locale = serverManager->GetDefaultLocale();
+                locale = serverManager->GetDefaultMessageLocale();
             }
         }
 

Modified: trunk/MgDev/Server/src/Common/Manager/LoadBalanceManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/LoadBalanceManager.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/Common/Manager/LoadBalanceManager.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -662,7 +662,7 @@
         catch (MgException* e)
         {
             // Server is down or request gets timed out? Log the message.
-            STRING locale = m_serverManager->GetDefaultLocale();
+            STRING locale = m_serverManager->GetDefaultMessageLocale();
 
             ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(locale).c_str()));
             MG_LOG_SYSTEM_ENTRY(LM_ERROR, e->GetDetails(locale).c_str());
@@ -752,7 +752,7 @@
         catch (MgException* e)
         {
             // Server is down or request gets timed out? Log the message.
-            STRING locale = m_serverManager->GetDefaultLocale();
+            STRING locale = m_serverManager->GetDefaultMessageLocale();
 
             ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(locale).c_str()));
             MG_LOG_SYSTEM_ENTRY(LM_ERROR, e->GetDetails(locale).c_str());
@@ -955,7 +955,7 @@
             catch (MgException* e)
             {
                 // Server is down or request gets timed out? Log the message.
-                STRING locale = m_serverManager->GetDefaultLocale();
+                STRING locale = m_serverManager->GetDefaultMessageLocale();
 
                 ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(locale).c_str()));
                 MG_LOG_SYSTEM_ENTRY(LM_ERROR, e->GetDetails(locale).c_str());
@@ -1560,7 +1560,7 @@
             catch (MgException* e)
             {
                 // Server is down or request gets timed out? Log the message.
-                STRING locale = m_serverManager->GetDefaultLocale();
+                STRING locale = m_serverManager->GetDefaultMessageLocale();
 
                 ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(locale).c_str()));
                 MG_LOG_SYSTEM_ENTRY(LM_ERROR, e->GetDetails(locale).c_str());
@@ -1630,7 +1630,7 @@
                 catch (MgException* e)
                 {
                     // Server is down or request gets timed out? Log the message.
-                    STRING locale = m_serverManager->GetDefaultLocale();
+                    STRING locale = m_serverManager->GetDefaultMessageLocale();
 
                     ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(locale).c_str()));
                     MG_LOG_SYSTEM_ENTRY(LM_ERROR, e->GetDetails(locale).c_str());
@@ -1732,7 +1732,7 @@
             catch (MgException* e)
             {
                 // Server is down or request gets timed out? Log the message.
-                STRING locale = m_serverManager->GetDefaultLocale();
+                STRING locale = m_serverManager->GetDefaultMessageLocale();
 
                 ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(locale).c_str()));
                 MG_LOG_SYSTEM_ENTRY(LM_ERROR, e->GetDetails(locale).c_str());
@@ -1759,7 +1759,7 @@
         catch (MgException* e)
         {
             // Server is down or request gets timed out? Log the message.
-            STRING locale = m_serverManager->GetDefaultLocale();
+            STRING locale = m_serverManager->GetDefaultMessageLocale();
 
             ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(locale).c_str()));
             MG_LOG_SYSTEM_ENTRY(LM_ERROR, e->GetDetails(locale).c_str());
@@ -1826,7 +1826,7 @@
             catch (MgException* e)
             {
                 // Server is down or request gets timed out? Log the message.
-                STRING locale = m_serverManager->GetDefaultLocale();
+                STRING locale = m_serverManager->GetDefaultMessageLocale();
 
                 ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(locale).c_str()));
                 MG_LOG_SYSTEM_ENTRY(LM_ERROR, e->GetDetails(locale).c_str());
@@ -1854,7 +1854,7 @@
         catch (MgException* e)
         {
             // Server is down or request gets timed out? Log the message.
-            STRING locale = m_serverManager->GetDefaultLocale();
+            STRING locale = m_serverManager->GetDefaultMessageLocale();
 
             ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(locale).c_str()));
             MG_LOG_SYSTEM_ENTRY(LM_ERROR, e->GetDetails(locale).c_str());

Modified: trunk/MgDev/Server/src/Common/Manager/LogThread.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/LogThread.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/Common/Manager/LogThread.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -97,8 +97,8 @@
                         {
                             MgServerManager* pServerManager = MgServerManager::GetInstance();
 
-                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(pServerManager->GetDefaultLocale()).c_str()));
-                            MG_LOG_EXCEPTION_ENTRY(e->GetMessage(pServerManager->GetDefaultLocale()).c_str(), e->GetStackTrace(pServerManager->GetDefaultLocale()).c_str());
+                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
+                            MG_LOG_EXCEPTION_ENTRY(e->GetMessage(pServerManager->GetDefaultMessageLocale()).c_str(), e->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 
                             SAFE_RELEASE(e);
                         }
@@ -117,8 +117,8 @@
                             MgServerManager* pServerManager = MgServerManager::GetInstance();
 
                             mgException = new MgFdoException(L"MgLogThread.svc", __LINE__, __WFILE__, NULL, messageId, &arguments);
-                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultLocale()).c_str()));
-                            MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultLocale()).c_str());
+                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
+                            MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 
                             FDO_SAFE_RELEASE(e);
                         }
@@ -127,16 +127,16 @@
                             MgServerManager* pServerManager = MgServerManager::GetInstance();
 
                             mgException = MgSystemException::Create(e, L"MgLogThread.svc", __LINE__, __WFILE__);
-                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultLocale()).c_str()));
-                            MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultLocale()).c_str());
+                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
+                            MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
                         }
                         catch(...)
                         {
                             MgServerManager* pServerManager = MgServerManager::GetInstance();
 
                             mgException = new MgUnclassifiedException(L"MgLogThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
-                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultLocale()).c_str()));
-                            MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultLocale()).c_str());
+                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
+                            MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
                         }
                     }
                 }
@@ -151,8 +151,8 @@
     {
         MgServerManager* pServerManager = MgServerManager::GetInstance();
 
-        ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(pServerManager->GetDefaultLocale()).c_str()));
-        MG_LOG_EXCEPTION_ENTRY(e->GetMessage(pServerManager->GetDefaultLocale()).c_str(), e->GetStackTrace(pServerManager->GetDefaultLocale()).c_str());
+        ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
+        MG_LOG_EXCEPTION_ENTRY(e->GetMessage(pServerManager->GetDefaultMessageLocale()).c_str(), e->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 
         SAFE_RELEASE(e);
 
@@ -163,8 +163,8 @@
         MgServerManager* pServerManager = MgServerManager::GetInstance();
 
         mgException = MgSystemException::Create(e, L"MgLogThread.svc", __LINE__, __WFILE__);
-        ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultLocale()).c_str()));
-        MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultLocale()).c_str());
+        ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
+        MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 
         nResult = -1;
     }
@@ -173,8 +173,8 @@
         MgServerManager* pServerManager = MgServerManager::GetInstance();
 
         mgException = new MgUnclassifiedException(L"MgLogThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
-        ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultLocale()).c_str()));
-        MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultLocale()).c_str());
+        ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
+        MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 
         nResult = -1;
     }

Modified: trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/Common/Manager/ServerManager.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -44,7 +44,7 @@
     m_pWorkerThreads(NULL)
 {
     m_localServerAddress = MgConfigProperties::DefaultGeneralPropertyMachineIp;
-    m_defaultLocale = MgConfigProperties::DefaultGeneralPropertyDefaultLocale;
+    m_defaultMessageLocale = MgConfigProperties::DefaultGeneralPropertyDefaultMessageLocale;
     m_displayName = MgConfigProperties::DefaultGeneralPropertyDisplayName;
 
     // Admin
@@ -127,8 +127,8 @@
 
     MG_LOG_TRACE_ENTRY(L"MgServerManager::Initialize()");
 
-    // Set the locale
-    m_defaultLocale = locale;
+    // Set the message locale
+    m_defaultMessageLocale = locale;
 
     m_pClientHandles = new ACE_Unbounded_Set<ACE_HANDLE>;
 
@@ -264,9 +264,9 @@
     MG_CATCH_AND_THROW(L"MgServerManager.LoadConfigurationProperties")
 }
 
-CREFSTRING MgServerManager::GetDefaultLocale()
+CREFSTRING MgServerManager::GetDefaultMessageLocale()
 {
-    return m_defaultLocale;
+    return m_defaultMessageLocale;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Server/src/Common/Manager/ServerManager.h
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/ServerManager.h	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/Common/Manager/ServerManager.h	2007-03-19 17:25:35 UTC (rev 1286)
@@ -53,7 +53,7 @@
     void Initialize(CREFSTRING locale);
     void LoadConfigurationProperties();
 
-    CREFSTRING GetDefaultLocale();
+    CREFSTRING GetDefaultMessageLocale();
 
     MgPropertyCollection* GetConfigurationProperties(CREFSTRING propertySection);
     void SetConfigurationProperties(CREFSTRING propertySection, MgPropertyCollection* properties);
@@ -155,7 +155,7 @@
     ServerStatus m_ssServerStatus;
     bool m_isSiteServer;
     STRING m_localServerAddress;
-    STRING m_defaultLocale;
+    STRING m_defaultMessageLocale;
     STRING m_displayName;
 
     // Admin Properties

Modified: trunk/MgDev/Server/src/Common/Manager/WorkerThread.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/WorkerThread.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/Common/Manager/WorkerThread.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -103,8 +103,8 @@
                         {
                             MgServerManager* pServerManager = MgServerManager::GetInstance();
 
-                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(pServerManager->GetDefaultLocale()).c_str()));
-                            MG_LOG_EXCEPTION_ENTRY(e->GetMessage(pServerManager->GetDefaultLocale()).c_str(), e->GetStackTrace(pServerManager->GetDefaultLocale()).c_str());
+                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
+                            MG_LOG_EXCEPTION_ENTRY(e->GetMessage(pServerManager->GetDefaultMessageLocale()).c_str(), e->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 
                             SAFE_RELEASE(e);
                         }
@@ -123,8 +123,8 @@
                             MgServerManager* pServerManager = MgServerManager::GetInstance();
 
                             mgException = new MgFdoException(L"MgWorkerThread.svc", __LINE__, __WFILE__, NULL, messageId, &arguments);
-                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultLocale()).c_str()));
-                            MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultLocale()).c_str());
+                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
+                            MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 
                             FDO_SAFE_RELEASE(e);
                         }
@@ -133,16 +133,16 @@
                             MgServerManager* pServerManager = MgServerManager::GetInstance();
 
                             mgException = MgSystemException::Create(e, L"MgWorkerThread.svc", __LINE__, __WFILE__);
-                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultLocale()).c_str()));
-                            MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultLocale()).c_str());
+                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
+                            MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
                         }
                         catch(...)
                         {
                             MgServerManager* pServerManager = MgServerManager::GetInstance();
 
                             mgException = new MgUnclassifiedException(L"MgWorkerThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
-                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultLocale()).c_str()));
-                            MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultLocale()).c_str());
+                            ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
+                            MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
                         }
                     }
                 }
@@ -157,8 +157,8 @@
     {
         MgServerManager* pServerManager = MgServerManager::GetInstance();
 
-        ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(pServerManager->GetDefaultLocale()).c_str()));
-        MG_LOG_EXCEPTION_ENTRY(e->GetMessage(pServerManager->GetDefaultLocale()).c_str(), e->GetStackTrace(pServerManager->GetDefaultLocale()).c_str());
+        ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
+        MG_LOG_EXCEPTION_ENTRY(e->GetMessage(pServerManager->GetDefaultMessageLocale()).c_str(), e->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 
         SAFE_RELEASE(e);
 
@@ -169,8 +169,8 @@
         MgServerManager* pServerManager = MgServerManager::GetInstance();
 
         mgException = MgSystemException::Create(e, L"MgWorkerThread.svc", __LINE__, __WFILE__);
-        ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultLocale()).c_str()));
-        MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultLocale()).c_str());
+        ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
+        MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 
         nResult = -1;
     }
@@ -179,8 +179,8 @@
         MgServerManager* pServerManager = MgServerManager::GetInstance();
 
         mgException = new MgUnclassifiedException(L"MgWorkerThread.svc", __LINE__, __WFILE__, NULL, L"", NULL);
-        ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultLocale()).c_str()));
-        MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultLocale()).c_str());
+        ACE_DEBUG ((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), mgException->GetDetails(pServerManager->GetDefaultMessageLocale()).c_str()));
+        MG_LOG_EXCEPTION_ENTRY(mgException->GetMessage(pServerManager->GetDefaultMessageLocale()).c_str(), mgException->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str());
 
         nResult = -1;
     }

Modified: trunk/MgDev/Server/src/Core/OperationThread.cpp
===================================================================
--- trunk/MgDev/Server/src/Core/OperationThread.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/Core/OperationThread.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -153,7 +153,7 @@
     {
         MgServerManager* serverManager = MgServerManager::GetInstance();
         STRING locale = (NULL == serverManager) ?
-            MgResources::DefaultLocale : serverManager->GetDefaultLocale();
+            MgResources::DefaultMessageLocale : serverManager->GetDefaultMessageLocale();
         STRING message = mgException->GetMessage(locale);
         STRING details = mgException->GetDetails(locale);
         STRING stackTrace = mgException->GetStackTrace(locale);
@@ -279,7 +279,7 @@
     {
         MgServerManager* serverManager = MgServerManager::GetInstance();
         STRING locale = (NULL == serverManager) ?
-            MgResources::DefaultLocale : serverManager->GetDefaultLocale();
+            MgResources::DefaultMessageLocale : serverManager->GetDefaultMessageLocale();
         STRING message = mgException->GetMessage(locale);
         STRING details = mgException->GetDetails(locale);
         STRING stackTrace = mgException->GetStackTrace(locale);
@@ -432,7 +432,7 @@
     {
         MgServerManager* serverManager = MgServerManager::GetInstance();
         STRING locale = (NULL == serverManager) ?
-            MgResources::DefaultLocale : serverManager->GetDefaultLocale();
+            MgResources::DefaultMessageLocale : serverManager->GetDefaultMessageLocale();
         STRING message = mgException->GetMessage(locale);
         STRING details = mgException->GetDetails(locale);
         STRING stackTrace = mgException->GetStackTrace(locale);

Modified: trunk/MgDev/Server/src/Core/Server.cpp
===================================================================
--- trunk/MgDev/Server/src/Core/Server.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/Core/Server.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -349,7 +349,7 @@
         catch (MgException* e)
         {
             ACE_DEBUG((LM_ERROR, ACE_TEXT("Unable to run all the unit tests.\n")));
-            ACE_DEBUG((LM_ERROR, ACE_TEXT("%W\n"), e->GetStackTrace(pServerManager->GetDefaultLocale()).c_str()));
+            ACE_DEBUG((LM_ERROR, ACE_TEXT("%W\n"), e->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str()));
             SAFE_RELEASE(e);
 
             nResult = -1;
@@ -452,7 +452,7 @@
         catch (MgException* e)
         {
             ACE_DEBUG((LM_ERROR, ACE_TEXT("Unable to run all the FDO unit tests.\n")));
-            ACE_DEBUG((LM_ERROR, ACE_TEXT("%W\n"), e->GetStackTrace(pServerManager->GetDefaultLocale()).c_str()));
+            ACE_DEBUG((LM_ERROR, ACE_TEXT("%W\n"), e->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str()));
             SAFE_RELEASE(e);
 
             nResult = -1;
@@ -635,10 +635,10 @@
         catch (MgException* e)
         {
             STRING message;
-            message = e->GetDetails(pServerManager->GetDefaultLocale());
+            message = e->GetDetails(pServerManager->GetDefaultMessageLocale());
 
             ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), message.c_str()));
-            ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetStackTrace(pServerManager->GetDefaultLocale()).c_str()));
+            ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e->GetStackTrace(pServerManager->GetDefaultMessageLocale()).c_str()));
 
             MG_LOG_SYSTEM_ENTRY(LM_ERROR, message.c_str());
             MG_LOG_ERROR_ENTRY(message.c_str());
@@ -710,10 +710,33 @@
         STRING resourcesPath;
         pConfiguration->GetStringValue(MgConfigProperties::GeneralPropertiesSection, MgConfigProperties::GeneralPropertyResourcesPath, resourcesPath, MgConfigProperties::DefaultGeneralPropertyResourcesPath);
 
-        // Get the default locale.
-        STRING defaultLocale;
-        pConfiguration->GetStringValue(MgConfigProperties::GeneralPropertiesSection, MgConfigProperties::GeneralPropertyDefaultLocale, defaultLocale, MgConfigProperties::DefaultGeneralPropertyDefaultLocale);
+        // Get the default message locale.
+        STRING defaultMessageLocale;
+        pConfiguration->GetStringValue(MgConfigProperties::GeneralPropertiesSection, MgConfigProperties::GeneralPropertyDefaultMessageLocale, defaultMessageLocale, MgConfigProperties::DefaultGeneralPropertyDefaultMessageLocale);
 
+        // Get the server locale.
+        STRING locale;
+        pConfiguration->GetStringValue(MgConfigProperties::GeneralPropertiesSection, MgConfigProperties::GeneralPropertyLocale, locale, MgConfigProperties::DefaultGeneralPropertyLocale);
+
+        char* serverLocale = NULL;
+
+        // If the server configuration property is defined use it
+        if(!locale.empty())
+        {
+            string localeTemp = MgUtil::WideCharToMultiByte(locale);
+            serverLocale = ::setlocale(LC_ALL, localeTemp.c_str());
+        }
+        else
+        {
+            // Set the locale to the system default
+            serverLocale = ::setlocale(LC_ALL, "");
+        }
+
+        STRING strLocale = MgUtil::MultiByteToWideChar(string(serverLocale));
+
+        // Always use the "C" locale when dealing with numbers
+        ::setlocale(LC_NUMERIC, "C");
+
         // Initialize the Log Manager
         ACE_DEBUG ((LM_DEBUG, ACE_TEXT("(%P|%t) MgServer::open() - Initializing Log Manager.\n")));
         MgLogManager* pLogManager = MgLogManager::GetInstance();
@@ -730,7 +753,7 @@
         // If that fails then we will not start the server because we need our resources.
         try
         {
-            pResources->LoadResources(defaultLocale);
+            pResources->LoadResources(defaultMessageLocale);
         }
         catch(MgException* e)
         {
@@ -738,24 +761,24 @@
 
             // Log error message about failing to load the specified locale resources
             MgStringCollection arguments;
-            arguments.Add(pResources->GetResourceFilename(defaultLocale));
-            arguments.Add(defaultLocale);
+            arguments.Add(pResources->GetResourceFilename(defaultMessageLocale));
+            arguments.Add(defaultMessageLocale);
 
             STRING message = pResources->FormatMessage(MgResources::FailedToLoadResourcesFile, &arguments);
             ACE_DEBUG((LM_INFO, ACE_TEXT("(%P|%t) %W\n"), message.c_str()));
             MG_LOG_ERROR_ENTRY(message.c_str());
 
             // Check to see if we were attempting to load the "en" locale resources.
-            if(MgResources::DefaultLocale == defaultLocale)
+            if(MgResources::DefaultMessageLocale == defaultMessageLocale)
             {
-                // The server needs to fail to start because the specified default locale was
+                // The server needs to fail to start because the specified default message locale was
                 // the same as "en"
                 nResult = -1;
             }
             else
             {
                 // Try loading the "en" locale resources instead
-                defaultLocale = MgResources::DefaultLocale;
+                defaultMessageLocale = MgResources::DefaultMessageLocale;
 
                 try
                 {
@@ -764,7 +787,7 @@
                     ACE_DEBUG((LM_INFO, ACE_TEXT("(%P|%t) %W\n"), message.c_str()));
                     MG_LOG_ERROR_ENTRY(message.c_str());
 
-                    pResources->LoadResources(defaultLocale);
+                    pResources->LoadResources(defaultMessageLocale);
                 }
                 catch(MgException* e)
                 {
@@ -773,8 +796,8 @@
 
                     // We also failed to load the default "en" resource 
                     MgStringCollection arguments;
-                    arguments.Add(pResources->GetResourceFilename(defaultLocale));
-                    arguments.Add(defaultLocale);
+                    arguments.Add(pResources->GetResourceFilename(defaultMessageLocale));
+                    arguments.Add(defaultMessageLocale);
 
                     STRING message = pResources->FormatMessage(MgResources::FailedToLoadResourcesFile, &arguments);
                     ACE_DEBUG((LM_INFO, ACE_TEXT("(%P|%t) %W\n"), message.c_str()));
@@ -806,7 +829,7 @@
             // Initialize the Server Manager
             ACE_DEBUG ((LM_DEBUG, ACE_TEXT("(%P|%t) MgServer::open() - Initializing Server Manager.\n")));
             MgServerManager* pServerManager = MgServerManager::GetInstance();
-            pServerManager->Initialize(defaultLocale);
+            pServerManager->Initialize(defaultMessageLocale);
 
             // We cannot add trace statements until the log manager is initialized.
             MG_LOG_TRACE_ENTRY(L"MgServer::open() - Start");
@@ -954,7 +977,7 @@
 
 #ifdef _DEBUG
             MgEventTimer& connectionTimer = m_eventTimerManager.GetEventTimer(MgEventTimer::ConnectionTimeout);
-            STRING strResourceFilename = pResources->GetResourceFilename(pServerManager->GetDefaultLocale());
+            STRING strResourceFilename = pResources->GetResourceFilename(pServerManager->GetDefaultMessageLocale());
 
             ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Server Information:\n")));
             ACE_DEBUG ((LM_DEBUG, ACE_TEXT("\n  Commandline Options:\n")));
@@ -962,10 +985,11 @@
             ACE_DEBUG ((LM_DEBUG, ACE_TEXT("    Test Mode                     : %s\n"), m_bTestMode == true ? ACE_TEXT("true") : ACE_TEXT("false")));
             ACE_DEBUG ((LM_DEBUG, ACE_TEXT("    Test FDO                      : %s\n"), m_bTestFdo == true ? ACE_TEXT("true") : ACE_TEXT("false")));
             ACE_DEBUG ((LM_DEBUG, ACE_TEXT("\n  General Properties:\n")));
+            ACE_DEBUG ((LM_DEBUG, ACE_TEXT("    Locale                        : %s\n"), MG_WCHAR_TO_TCHAR(strLocale)));
             ACE_DEBUG ((LM_DEBUG, ACE_TEXT("    Machine IP                    : %s\n"), MG_WCHAR_TO_TCHAR(loadBalanceManager->GetLocalServerAddress())));
             ACE_DEBUG ((LM_DEBUG, ACE_TEXT("    Fdo path                      : %s\n"), MG_WCHAR_TO_TCHAR(fdoPath)));
             ACE_DEBUG ((LM_DEBUG, ACE_TEXT("    Logs path                     : %s\n"), MG_WCHAR_TO_TCHAR(pLogManager->GetLogsPath())));
-            ACE_DEBUG ((LM_DEBUG, ACE_TEXT("    Locale (Default)              : %s\n"), MG_WCHAR_TO_TCHAR(pServerManager->GetDefaultLocale())));
+            ACE_DEBUG ((LM_DEBUG, ACE_TEXT("    Default Message Locale        : %s\n"), MG_WCHAR_TO_TCHAR(pServerManager->GetDefaultMessageLocale())));
             ACE_DEBUG ((LM_DEBUG, ACE_TEXT("    Locale Resources File Loaded  : %s\n"), MG_WCHAR_TO_TCHAR(strResourceFilename)));
             ACE_DEBUG ((LM_DEBUG, ACE_TEXT("\n  Client Service Properties:\n")));
             ACE_DEBUG ((LM_DEBUG, ACE_TEXT("    Connection Timeout            : %d\n"), connectionTimer.GetEventTimeout()));
@@ -1037,7 +1061,7 @@
 
         MgServerManager* serverManager = MgServerManager::GetInstance();
         STRING locale = (NULL == serverManager) ?
-            MgResources::DefaultLocale : serverManager->GetDefaultLocale();
+            MgResources::DefaultMessageLocale : serverManager->GetDefaultMessageLocale();
         STRING message = mgException->GetMessage(locale);
         STRING details = mgException->GetDetails(locale);
         STRING stackTrace = mgException->GetStackTrace(locale);

Modified: trunk/MgDev/Server/src/Core/TimedEventHandler.cpp
===================================================================
--- trunk/MgDev/Server/src/Core/TimedEventHandler.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/Core/TimedEventHandler.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -143,10 +143,10 @@
     
     if (NULL != serverManager)
     {
-        CREFSTRING defaultLocale = serverManager->GetDefaultLocale();
+        CREFSTRING locale = serverManager->GetDefaultMessageLocale();
 
-        ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e.GetDetails(defaultLocale).c_str()));
-        MG_LOG_EXCEPTION_ENTRY(e.GetMessage(defaultLocale).c_str(), e.GetStackTrace(defaultLocale).c_str());
+        ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), e.GetDetails(locale).c_str()));
+        MG_LOG_EXCEPTION_ENTRY(e.GetMessage(locale).c_str(), e.GetStackTrace(locale).c_str());
     }
     
     MG_CATCH_AND_RELEASE()

Modified: trunk/MgDev/Server/src/Core/main.cpp
===================================================================
--- trunk/MgDev/Server/src/Core/main.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/Core/main.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -66,9 +66,6 @@
     #endif
 #endif
 
-    // Set the locale to the C locale
-    ::setlocale(LC_ALL, "C");
-
     ACE::init();
 
     // we need initialize Xerces before BDB
@@ -359,7 +356,7 @@
     {
         MgServerManager* serverManager = MgServerManager::GetInstance();
         STRING locale = (NULL == serverManager) ?
-            MgResources::DefaultLocale : serverManager->GetDefaultLocale();
+            MgResources::DefaultMessageLocale : serverManager->GetDefaultMessageLocale();
         STRING details = mgException->GetDetails(locale);
 
         ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) %W\n"), details.c_str()));

Modified: trunk/MgDev/Server/src/Core/serverconfig.ini
===================================================================
--- trunk/MgDev/Server/src/Core/serverconfig.ini	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/Core/serverconfig.ini	2007-03-19 17:25:35 UTC (rev 1286)
@@ -38,7 +38,7 @@
 # ConnectionTimerInterval          Time interval in seconds for when the server
 #                                  checks for idle connections
 #                                       0 < Value <= 2147483647
-# DefaultLocale                    ISO 639-1 name for the locale
+# DefaultMessageLocale             ISO 639-1 name for the message locale
 #                                       Length = 2
 # DisplayName                      Display name of the server
 #                                       0 <= Length <= 255
@@ -46,6 +46,8 @@
 # FdoPath                          Path where FDO is installed
 # LicenseServerPath                The path to the License server (not used by MapGuide Open Source)
 #                                       0 <= Length <= 255
+# Locale                           The server's locale. If left blank it will default to the operating system locale
+#                                       0 <= Length <= 255
 # LogsDelimiter                    Delimiter that separates the data fields in
 #                                  the log files
 #                                       0 < Length <= 128
@@ -75,10 +77,11 @@
 # *****************************************************************************
 ConnectionTimeout                  = 120
 ConnectionTimerInterval            = 60
-DefaultLocale                      = en
+DefaultMessageLocale               = en
 DisplayName                        = 
 FdoPath                            = FDO/
 LicenseServerPath                  = @localhost
+Locale                             = 
 LogsDelimiter                      = \t
 LogsPath                           = Logs/
 MachineIp                          = 127.0.0.1

Modified: trunk/MgDev/Server/src/Services/Mapping/StylizationUtil.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/StylizationUtil.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/Services/Mapping/StylizationUtil.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -1001,7 +1001,7 @@
             // TODO: Eventually this should be used to indicate visually to the client what
             //       layer failed in addition to logging the error.
             MgServerManager* serverManager = MgServerManager::GetInstance();
-            STRING locale = (NULL == serverManager) ?  MgResources::DefaultLocale : serverManager->GetDefaultLocale();
+            STRING locale = (NULL == serverManager) ?  MgResources::DefaultMessageLocale : serverManager->GetDefaultMessageLocale();
 
             // Get the layer that failed
             MgStringCollection arguments;

Modified: trunk/MgDev/Server/src/UnitTesting/TestServerManager.cpp
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestServerManager.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/UnitTesting/TestServerManager.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -59,12 +59,12 @@
 ///----------------------------------------------------------------------------
 /// Test Case Description:
 ///
-/// This test case checks the default locale.
+/// This test case checks the default message locale.
 ///----------------------------------------------------------------------------
-void TestServerManager::TestCase_GetDefaultLocale()
+void TestServerManager::TestCase_GetDefaultMessageLocale()
 {
     MgServerManager* pMgServerManager = MgServerManager::GetInstance();
-    CREFSTRING locale = pMgServerManager->GetDefaultLocale();
+    CREFSTRING locale = pMgServerManager->GetDefaultMessageLocale();
 
     CPPUNIT_ASSERT(wcscmp(locale.c_str(), TEST_LOCALE.c_str()) == 0);
 }

Modified: trunk/MgDev/Server/src/UnitTesting/TestServerManager.h
===================================================================
--- trunk/MgDev/Server/src/UnitTesting/TestServerManager.h	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Server/src/UnitTesting/TestServerManager.h	2007-03-19 17:25:35 UTC (rev 1286)
@@ -26,7 +26,7 @@
     CPPUNIT_TEST(TestStart); // This must be the very first unit test
 
     CPPUNIT_TEST(TestCase_ValidServerManager);
-    CPPUNIT_TEST(TestCase_GetDefaultLocale);
+    CPPUNIT_TEST(TestCase_GetDefaultMessageLocale);
     CPPUNIT_TEST(TestCase_GetAdminPort);
     CPPUNIT_TEST(TestCase_GetClientPort);
     CPPUNIT_TEST(TestCase_GetSitePort);
@@ -45,7 +45,7 @@
     void TestEnd();
 
     void TestCase_ValidServerManager();
-    void TestCase_GetDefaultLocale();
+    void TestCase_GetDefaultMessageLocale();
     void TestCase_GetAdminPort();
     void TestCase_GetClientPort();
     void TestCase_GetSitePort();

Modified: trunk/MgDev/Web/src/WebSupport/InitializeWebTier.cpp
===================================================================
--- trunk/MgDev/Web/src/WebSupport/InitializeWebTier.cpp	2007-03-19 17:03:01 UTC (rev 1285)
+++ trunk/MgDev/Web/src/WebSupport/InitializeWebTier.cpp	2007-03-19 17:25:35 UTC (rev 1286)
@@ -46,7 +46,7 @@
         config->GetStringValue(MgConfigProperties::GeneralPropertiesSection, MgConfigProperties::GeneralPropertyResourcesPath, resourcesPath, MgConfigProperties::DefaultGeneralPropertyResourcesPath);
 
         STRING locale;
-        config->GetStringValue(MgConfigProperties::GeneralPropertiesSection, MgConfigProperties::GeneralPropertyDefaultLocale, locale, MgConfigProperties::DefaultGeneralPropertyDefaultLocale);
+        config->GetStringValue(MgConfigProperties::GeneralPropertiesSection, MgConfigProperties::GeneralPropertyDefaultMessageLocale, locale, MgConfigProperties::DefaultGeneralPropertyDefaultMessageLocale);
 
         resources->Initialize(resourcesPath);
         resources->LoadResources(locale);



More information about the mapguide-commits mailing list