g-ir-{compiler,generate,inspect}: Call setlocale in main function

It is required to correctly show translated messages on some locales.

https://bugzilla.gnome.org/show_bug.cgi?id=760419
This commit is contained in:
Ting-Wei Lan 2016-01-11 13:35:34 +08:00 committed by Evan Welsh
parent 380ec88f48
commit 496669495c

View File

@ -20,6 +20,7 @@
*/ */
#include <errno.h> #include <errno.h>
#include <locale.h>
#include <string.h> #include <string.h>
#include <glib.h> #include <glib.h>
@ -148,6 +149,8 @@ main (int argc, char ** argv)
gint i; gint i;
g_typelib_check_sanity (); g_typelib_check_sanity ();
setlocale (LC_ALL, "");
context = g_option_context_new (""); context = g_option_context_new ("");
g_option_context_add_main_entries (context, options, NULL); g_option_context_add_main_entries (context, options, NULL);
g_option_context_parse (context, &argc, &argv, &error); g_option_context_parse (context, &argc, &argv, &error);