No-Op: rename Normalizer to Intermediate
[ardour.git] / gtk2_ardour / main.cc
index 83f849185502d108e701c5999f5ba7f7bf789285..a123631a54cc0f2b3219b919e67f2f8767a49e9e 100644 (file)
 */
 
 #include <cstdlib>
-#include <signal.h>
 #include <cerrno>
 #include <vector>
 
+#include <signal.h>
+#include <locale.h>
+
 #include <sigc++/bind.h>
 #include <gtkmm/settings.h>
 
@@ -56,7 +58,7 @@
 #include "enums.h"
 #include "bundle_env.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 #ifdef PLATFORM_WINDOWS
 #include <fcntl.h> // Needed for '_fmode'
@@ -294,7 +296,13 @@ int main (int argc, char *argv[])
 #endif
 
 #ifdef ENABLE_NLS
-       gtk_set_locale ();
+       /* initialize C and C++ locales to user preference */
+       setlocale (LC_ALL, "");
+       try {
+               std::locale::global (std::locale (setlocale (LC_ALL, 0)));
+       } catch (...) {
+               std::cerr << "Cannot set C++ locale\n";
+       }
 #endif
 
        console_madness_begin();
@@ -377,6 +385,8 @@ int main (int argc, char *argv[])
        }
 #endif
 
+       DEBUG_TRACE (DEBUG::Locale, string_compose ("main() locale '%1'\n", setlocale (LC_NUMERIC, NULL)));
+
        if (UIConfiguration::instance().pre_gui_init ()) {
                error << _("Could not complete pre-GUI initialization") << endmsg;
                exit (1);