Update Mapgen VoxelManipulator on buffer invalidation
[oweals/minetest.git] / src / gettext.cpp
index 455c78584034eebe365e3dc024065dcebb9bec6b..0c0e520ca169e4322834edc5cfb647e0f92e6959 100644 (file)
@@ -24,7 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "gettext.h"
 #include "util/string.h"
 
-#if USE_GETTEXT and defined(_MSC_VER)
+#if USE_GETTEXT && defined(_MSC_VER)
 #include <WinNls.h>
 #include <map>
 #include <direct.h>
@@ -142,13 +142,14 @@ void init_gettext(const char *path,std::string configured_language) {
 
                SetEnvironmentVariableA("LANGUAGE",configured_language.c_str());
 
+#ifndef SERVER
                //very very dirty workaround to force gettext to see the right environment
                if (current_language_var != configured_language) {
                        STARTUPINFO startupinfo;
                        PROCESS_INFORMATION processinfo;
                        memset(&startupinfo,0,sizeof(startupinfo));
                        memset(&processinfo,0,sizeof(processinfo));
-                       errorstream << "MSVC localization workaround aktive restating minetest in new environment!" << std::endl;
+                       errorstream << "MSVC localization workaround active restating minetest in new environment!" << std::endl;
 
                        std::string parameters = "";
 
@@ -199,6 +200,13 @@ void init_gettext(const char *path,std::string configured_language) {
                        else {
                                exit(0);
                        }
+#else
+                       errorstream << "*******************************************************" << std::endl;
+                       errorstream << "Can't apply locale workaround for server!" << std::endl;
+                       errorstream << "Expect language to be broken!" << std::endl;
+                       errorstream << "*******************************************************" << std::endl;
+
+#endif
                }
 
                setlocale(LC_ALL,configured_language.c_str());
@@ -243,15 +251,17 @@ void init_gettext(const char *path,std::string configured_language) {
        //errorstream << "Gettext debug: domainname = " << tdomain << "; codeset = "<< codeset << std::endl;
 #endif // defined(_WIN32)
 
+#else
+       /* set current system default locale */
+       setlocale(LC_ALL, "");
+#endif // if USE_GETTEXT
+
        /* no matter what locale is used we need number format to be "C" */
        /* to ensure formspec parameters are evaluated correct!          */
 
-
        setlocale(LC_NUMERIC,"C");
        infostream << "Message locale is now set to: "
                        << setlocale(LC_ALL,0) << std::endl;
-                       
-#endif // if USE_GETTEXT
 }