[gnome-control-center/wip/hadess/setlocale] shell: Initialise locale early
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/hadess/setlocale] shell: Initialise locale early
- Date: Thu, 10 Mar 2022 13:32:48 +0000 (UTC)
commit b544f25c83f182a78420540d9d51de17cdd1d9ae
Author: Bastien Nocera <hadess hadess net>
Date: Thu Feb 10 10:27:56 2022 +0100
shell: Initialise locale early
Otherwise glib will make internal calls before setlocale is called:
** (process:1124144): WARNING **: 10:16:58.983: dcgettext("(null)", "", 5) called before setlocale()
#0 0x00007ffff7c80f77 in g_logv () at /lib64/libglib-2.0.so.0
#1 0x00007ffff7c81233 in g_log () at /lib64/libglib-2.0.so.0
#2 0x00007ffff7fbb6c6 in dcgettext (__domainname=<optimized out>, __msgid=0x7ffff7ce6c5a "",
__category=<optimized out>) at ../../../../Projects/jhbuild/gettext-pseudolocale/gettext-pseudolocale.c:194
#3 0x00007ffff7c6478e in _g_dgettext_should_translate () at /lib64/libglib-2.0.so.0
#4 0x00007ffff7c6484b in g_dgettext () at /lib64/libglib-2.0.so.0
#5 0x00007ffff7e98974 in g_application_class_intern_init () at /lib64/libgio-2.0.so.0
#6 0x00007ffff7d9cfb8 in g_type_class_ref () at /lib64/libgobject-2.0.so.0
#7 0x00007ffff7d9cc95 in g_type_class_ref () at /lib64/libgobject-2.0.so.0
#8 0x00007ffff7d9cc95 in g_type_class_ref () at /lib64/libgobject-2.0.so.0
#9 0x00007ffff7d9cc95 in g_type_class_ref () at /lib64/libgobject-2.0.so.0
#10 0x00007ffff7d8671a in g_object_new_valist () at /lib64/libgobject-2.0.so.0
#11 0x00007ffff7d867fd in g_object_new () at /lib64/libgobject-2.0.so.0
#12 0x0000000000449bcc in cc_application_new () at
../../../../Projects/jhbuild/gnome-control-center/shell/cc-application.c:294
#13 0x0000000000448fa6 in main (argc=1, argv=0x7fffffffd138) at
../../../../Projects/jhbuild/gnome-control-center/shell/main.c:55
shell/main.c | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/shell/main.c b/shell/main.c
index e3ac0f327..fc2e0cf84 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -22,6 +22,7 @@
#include "config.h"
#include <stdlib.h>
+#include <locale.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
@@ -50,6 +51,8 @@ main (gint argc,
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
+ setlocale(LC_ALL, "");
+
initialize_dependencies (&argc, &argv);
application = cc_application_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]