summaryrefslogtreecommitdiff
path: root/gtk/gtkmain.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-04-22 07:35:37 +0000
committerTor Lillqvist <tml@src.gnome.org>2005-04-22 07:35:37 +0000
commit474ddd204ad4f3c07b6d372a558d7cb16f5e71c9 (patch)
tree7fe7d8ecdc5bf5e31648a215ba81f60ed55270e7 /gtk/gtkmain.c
parente41ade967e06b92b039fef05904e6919dce212db (diff)
downloadgtk+-474ddd204ad4f3c07b6d372a558d7cb16f5e71c9.tar.gz
Initailize gettext before use. Calling bindtextdomain() and
2005-04-22 Tor Lillqvist <tml@novell.com> * gtk/gtkmain.c: Initailize gettext before use. Calling bindtextdomain() and bind_textdomain_codeset() in do_post_parse_initialization() is too late. Put the calls in a new function gettext_initialization(), and call that from gtk_init_with_args() and gtk_parse_args(). Fixes #170948 for GTK+'s part, but the same problem occurs also at least in atk. Thanks to Robert Ă–gren, Daniel Atallah and Kevin Strange.
Diffstat (limited to 'gtk/gtkmain.c')
-rw-r--r--gtk/gtkmain.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index f47f1eb3ff..68785b4464 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -464,15 +464,6 @@ do_post_parse_initialization (int *argc,
if (gtk_debug_flags & GTK_DEBUG_UPDATES)
gdk_window_set_debug_updates (TRUE);
-#ifdef ENABLE_NLS
- bindtextdomain (GETTEXT_PACKAGE, GTK_LOCALEDIR);
- bindtextdomain (GETTEXT_PACKAGE "-properties", GTK_LOCALEDIR);
-# ifdef HAVE_BIND_TEXTDOMAIN_CODESET
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- bind_textdomain_codeset (GETTEXT_PACKAGE "-properties", "UTF-8");
-# endif
-#endif
-
{
/* Translate to default:RTL if you want your widgets
* to be RTL, otherwise translate to default:LTR.
@@ -572,6 +563,19 @@ gtk_get_option_group (gboolean open_default_display)
return group;
}
+static void
+gettext_initialization (void)
+{
+#ifdef ENABLE_NLS
+ bindtextdomain (GETTEXT_PACKAGE, GTK_LOCALEDIR);
+ bindtextdomain (GETTEXT_PACKAGE "-properties", GTK_LOCALEDIR);
+# ifdef HAVE_BIND_TEXTDOMAIN_CODESET
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ bind_textdomain_codeset (GETTEXT_PACKAGE "-properties", "UTF-8");
+# endif
+#endif
+}
+
/**
* gtk_init_with_args:
* @argc: a pointer to the number of command line arguments.
@@ -615,6 +619,8 @@ gtk_init_with_args (int *argc,
if (!check_setugid ())
return FALSE;
+ gettext_initialization ();
+
gtk_group = gtk_get_option_group (TRUE);
context = g_option_context_new (parameter_string);
@@ -660,6 +666,8 @@ gtk_parse_args (int *argc,
if (!check_setugid ())
return FALSE;
+ gettext_initialization ();
+
option_context = g_option_context_new (NULL);
g_option_context_set_ignore_unknown_options (option_context, TRUE);
g_option_context_set_help_enabled (option_context, FALSE);