[libgda/gtk3] Tools: take locale into account



commit 55e1a537d9ea3f28ae486f48f71be3c225405468
Author: Vivien Malerba <malerba gnome-db org>
Date:   Thu Jan 20 19:36:30 2011 +0100

    Tools: take locale into account

 tools/browser/main.c |    8 ++++++++
 tools/gda-sql.c      |    4 ++++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/tools/browser/main.c b/tools/browser/main.c
index bed1f99..14e9022 100644
--- a/tools/browser/main.c
+++ b/tools/browser/main.c
@@ -33,6 +33,10 @@
 #include "browser-stock-icons.h"
 #include "../config-info.h"
 
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
 /* Perspectives' factories */
 #include "schema-browser/perspective-main.h"
 #include "query-exec/perspective-main.h"
@@ -106,6 +110,7 @@ main (int argc, char *argv[])
 	/* treat here lists of providers and defined DSN */
 	if (list_providers) {
 		gda_init ();
+		setlocale (LC_ALL, "");
 		GdaDataModel *model;
 		if (argc == 2)
 			model = config_info_detail_provider (argv[1], &error);
@@ -125,6 +130,7 @@ main (int argc, char *argv[])
 	}
 	if (list_configs) {
 		gda_init ();
+		setlocale (LC_ALL, "");
 		GdaDataModel *model = config_info_list_all_dsn ();
 		output_data_model (model);
 		g_object_unref (model);
@@ -135,6 +141,7 @@ main (int argc, char *argv[])
 		GdaDataModel *model;
 
 		gda_init ();
+		setlocale (LC_ALL, "");
 		confdir = config_info_compute_dict_directory ();
 		g_print (_("All files are in the directory: %s\n"), confdir);
 		g_free (confdir);
@@ -152,6 +159,7 @@ main (int argc, char *argv[])
 		gchar *tmp;
 
 		gda_init ();
+		setlocale (LC_ALL, "");
 		tmp = config_info_purge_data_files (purge_data_files, &error);
 		if (tmp) {
 			g_print ("%s\n", tmp);
diff --git a/tools/gda-sql.c b/tools/gda-sql.c
index c475fb1..1d78fc1 100644
--- a/tools/gda-sql.c
+++ b/tools/gda-sql.c
@@ -39,6 +39,9 @@
 #include <libgda/gda-quark-list.h>
 #include <libgda/gda-meta-struct.h>
 #include <libgda/gda-blob-op.h>
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
 
 #ifndef G_OS_WIN32
 #include <signal.h>
@@ -180,6 +183,7 @@ main (int argc, char *argv[])
 	}
 
 	g_setenv ("GDA_CONFIG_SYNCHRONOUS", "1", TRUE);
+	setlocale (LC_ALL, "");
         gda_init ();
 
 	has_threads = g_thread_supported ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]