[glib/glib.fixtools.i18n: 2/2] gio tools: Use the proper string for default locale for setlocale()



commit 26223c6b46d7632ba12b4c688fe500761f1b9c24
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jun 5 16:42:30 2019 +0800

    gio tools: Use the proper string for default locale for setlocale()
    
    This makes use of the string we now have from glibconfig.h.in in the
    last commit so that setlocale() sets the default system locale
    correctly and therefore show the translated messages properly.
    
    Fixes issue #1169.

 gio/gio-querymodules.c       | 2 +-
 gio/gio-tool.c               | 2 +-
 gio/glib-compile-resources.c | 2 +-
 gio/glib-compile-schemas.c   | 2 +-
 gio/gresource-tool.c         | 2 +-
 gio/gsettings-tool.c         | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gio/gio-querymodules.c b/gio/gio-querymodules.c
index 74c659462..933e8f7b2 100644
--- a/gio/gio-querymodules.c
+++ b/gio/gio-querymodules.c
@@ -160,7 +160,7 @@ main (gint   argc,
       return 1;
     }
 
-  setlocale (LC_ALL, "");
+  setlocale (LC_ALL, GLIB_DEFAULT_LOCALE_STRING);
 
   /* Be defensive and ensure we're linked to GObject */
   g_type_ensure (G_TYPE_OBJECT);
diff --git a/gio/gio-tool.c b/gio/gio-tool.c
index 847a2188b..b00b6a227 100644
--- a/gio/gio-tool.c
+++ b/gio/gio-tool.c
@@ -253,7 +253,7 @@ main (int argc, char **argv)
   const char *command;
   gboolean do_help;
 
-  setlocale (LC_ALL, "");
+  setlocale (LC_ALL, GLIB_DEFAULT_LOCALE_STRING);
   textdomain (GETTEXT_PACKAGE);
   bindtextdomain (GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
 
diff --git a/gio/glib-compile-resources.c b/gio/glib-compile-resources.c
index 399c567d2..0b47cc92d 100644
--- a/gio/glib-compile-resources.c
+++ b/gio/glib-compile-resources.c
@@ -754,7 +754,7 @@ main (int argc, char **argv)
   gchar *tmp;
 #endif
 
-  setlocale (LC_ALL, "");
+  setlocale (LC_ALL, GLIB_DEFAULT_LOCALE_STRING);
   textdomain (GETTEXT_PACKAGE);
 
 #ifdef G_OS_WIN32
diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
index 8ad3c6be1..6df222a76 100644
--- a/gio/glib-compile-schemas.c
+++ b/gio/glib-compile-schemas.c
@@ -2154,7 +2154,7 @@ main (int argc, char **argv)
   gchar *tmp = NULL;
 #endif
 
-  setlocale (LC_ALL, "");
+  setlocale (LC_ALL, GLIB_DEFAULT_LOCALE_STRING);
   textdomain (GETTEXT_PACKAGE);
 
 #ifdef G_OS_WIN32
diff --git a/gio/gresource-tool.c b/gio/gresource-tool.c
index d1de02631..482503907 100644
--- a/gio/gresource-tool.c
+++ b/gio/gresource-tool.c
@@ -610,7 +610,7 @@ main (int argc, char *argv[])
   gchar *tmp;
 #endif
 
-  setlocale (LC_ALL, "");
+  setlocale (LC_ALL, GLIB_DEFAULT_LOCALE_STRING);
   textdomain (GETTEXT_PACKAGE);
 
 #ifdef G_OS_WIN32
diff --git a/gio/gsettings-tool.c b/gio/gsettings-tool.c
index b7dd9d8fb..3070ce51b 100644
--- a/gio/gsettings-tool.c
+++ b/gio/gsettings-tool.c
@@ -743,7 +743,7 @@ main (int argc, char **argv)
   gchar *tmp;
 #endif
 
-  setlocale (LC_ALL, "");
+  setlocale (LC_ALL, GLIB_DEFAULT_LOCALE_STRING);
   textdomain (GETTEXT_PACKAGE);
 
 #ifdef G_OS_WIN32


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