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 Philip Withnall
parent 43d2206bcf
commit 55bca7b445
2 changed files with 7 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#include <glib.h>
#include <girepository.h>
#include <stdlib.h>
#include <locale.h>
static void
print_shlibs (const gchar *namespace)
@ -77,6 +78,8 @@ main (gint argc,
{ NULL },
};
setlocale (LC_ALL, "");
GOptionContext *context = g_option_context_new ("- Inspect GI typelib");
g_option_context_add_main_entries (context, options, NULL);
if (!g_option_context_parse (context, &argc, &argv, &error))

View File

@ -20,6 +20,8 @@
* Boston, MA 02111-1307, USA.
*/
#include <locale.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <gmodule.h>
@ -54,6 +56,8 @@ main (int argc, char *argv[])
g_typelib_check_sanity ();
setlocale (LC_ALL, "");
context = g_option_context_new ("");
g_option_context_add_main_entries (context, options, NULL);
g_option_context_parse (context, &argc, &argv, &error);