mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-12 20:36:15 +01:00
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:
parent
43d2206bcf
commit
55bca7b445
@ -22,6 +22,7 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <girepository.h>
|
#include <girepository.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_shlibs (const gchar *namespace)
|
print_shlibs (const gchar *namespace)
|
||||||
@ -77,6 +78,8 @@ main (gint argc,
|
|||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
setlocale (LC_ALL, "");
|
||||||
|
|
||||||
GOptionContext *context = g_option_context_new ("- Inspect GI typelib");
|
GOptionContext *context = g_option_context_new ("- Inspect GI typelib");
|
||||||
g_option_context_add_main_entries (context, options, NULL);
|
g_option_context_add_main_entries (context, options, NULL);
|
||||||
if (!g_option_context_parse (context, &argc, &argv, &error))
|
if (!g_option_context_parse (context, &argc, &argv, &error))
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
#include <gmodule.h>
|
#include <gmodule.h>
|
||||||
@ -54,6 +56,8 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user