Commit 9f709fe1 authored by Chun-wei Fan's avatar Chun-wei Fan

gio tools: Use the proper string for default locale for setlocale()

This makes use of the string we now have from glib-private.h in the
last commit so that setlocale() sets the default system locale
correctly and therefore show the translated messages properly.

Fixes issue #1169.
parent 3e5d1bd6
......@@ -26,6 +26,8 @@
#include <errno.h>
#include <locale.h>
#include "glib/glib-private.h"
static gboolean
is_valid_module_name (const gchar *basename)
{
......@@ -160,7 +162,7 @@ main (gint argc,
return 1;
}
setlocale (LC_ALL, "");
setlocale (LC_ALL, GLIB_DEFAULT_LOCALE);
/* Be defensive and ensure we're linked to GObject */
g_type_ensure (G_TYPE_OBJECT);
......
......@@ -28,7 +28,7 @@
#include <errno.h>
#include "gio-tool.h"
#include "glib/glib-private.h"
void
print_error (const gchar *format, ...)
......@@ -253,7 +253,7 @@ main (int argc, char **argv)
const char *command;
gboolean do_help;
setlocale (LC_ALL, "");
setlocale (LC_ALL, GLIB_DEFAULT_LOCALE);
textdomain (GETTEXT_PACKAGE);
bindtextdomain (GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
......
......@@ -43,10 +43,7 @@
#include "gvdb/gvdb-builder.h"
#include "gconstructor_as_data.h"
#ifdef G_OS_WIN32
#include "glib/glib-private.h"
#endif
typedef struct
{
......@@ -754,7 +751,7 @@ main (int argc, char **argv)
gchar *tmp;
#endif
setlocale (LC_ALL, "");
setlocale (LC_ALL, GLIB_DEFAULT_LOCALE);
textdomain (GETTEXT_PACKAGE);
#ifdef G_OS_WIN32
......
......@@ -29,10 +29,7 @@
#include "gvdb/gvdb-builder.h"
#include "strinfo.c"
#ifdef G_OS_WIN32
#include "glib/glib-private.h"
#endif
static void
strip_string (GString *string)
......@@ -2188,7 +2185,7 @@ main (int argc, char **argv)
gchar *tmp = NULL;
#endif
setlocale (LC_ALL, "");
setlocale (LC_ALL, GLIB_DEFAULT_LOCALE);
textdomain (GETTEXT_PACKAGE);
#ifdef G_OS_WIN32
......
......@@ -41,9 +41,7 @@
#include <glib/gstdio.h>
#include <gi18n.h>
#ifdef G_OS_WIN32
#include "glib/glib-private.h"
#endif
#if defined(HAVE_LIBELF) && defined(HAVE_MMAP)
#define USE_LIBELF
......@@ -610,7 +608,7 @@ main (int argc, char *argv[])
gchar *tmp;
#endif
setlocale (LC_ALL, "");
setlocale (LC_ALL, GLIB_DEFAULT_LOCALE);
textdomain (GETTEXT_PACKAGE);
#ifdef G_OS_WIN32
......
......@@ -25,9 +25,7 @@
#include <string.h>
#include <stdlib.h>
#ifdef G_OS_WIN32
#include "glib/glib-private.h"
#endif
static GSettingsSchemaSource *global_schema_source;
static GSettings *global_settings;
......@@ -743,7 +741,7 @@ main (int argc, char **argv)
gchar *tmp;
#endif
setlocale (LC_ALL, "");
setlocale (LC_ALL, GLIB_DEFAULT_LOCALE);
textdomain (GETTEXT_PACKAGE);
#ifdef G_OS_WIN32
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment