gio-tool.c: Don't hardcode localedir on Windows

We ought to construct the localedir based on the location of the GLib
DLL, like what the other tools do.
This commit is contained in:
Chun-wei Fan 2019-06-14 12:34:58 +08:00
parent 9f709fe1e9
commit 3046f7b3bb

View File

@ -253,9 +253,20 @@ main (int argc, char **argv)
const char *command;
gboolean do_help;
#ifdef G_OS_WIN32
gchar *localedir;
#endif
setlocale (LC_ALL, GLIB_DEFAULT_LOCALE);
textdomain (GETTEXT_PACKAGE);
#ifdef G_OS_WIN32
localedir = _glib_get_locale_dir ();
bindtextdomain (GETTEXT_PACKAGE, localedir);
g_free (localedir);
#else
bindtextdomain (GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
#endif
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");