]> Pileus Git - ~andy/gtk/commitdiff
Initailize gettext before use. Calling bindtextdomain() and
authorTor Lillqvist <tml@novell.com>
Fri, 22 Apr 2005 07:35:37 +0000 (07:35 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Fri, 22 Apr 2005 07:35:37 +0000 (07:35 +0000)
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.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkmain.c

index 40e7be14875417adb9911db6559c56e89d9e95ec..0ccc0a1fb88d7f4ceb094a0de50777d12f6f1de1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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.
+
 2005-04-19  Ivan, Wong Yat Cheung  <email@ivanwong.info>
 
        * gdk/win32/gdkfont-win32.c (gdk_font_load_internal): Match
index 40e7be14875417adb9911db6559c56e89d9e95ec..0ccc0a1fb88d7f4ceb094a0de50777d12f6f1de1 100644 (file)
@@ -1,3 +1,13 @@
+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.
+
 2005-04-19  Ivan, Wong Yat Cheung  <email@ivanwong.info>
 
        * gdk/win32/gdkfont-win32.c (gdk_font_load_internal): Match
index 40e7be14875417adb9911db6559c56e89d9e95ec..0ccc0a1fb88d7f4ceb094a0de50777d12f6f1de1 100644 (file)
@@ -1,3 +1,13 @@
+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.
+
 2005-04-19  Ivan, Wong Yat Cheung  <email@ivanwong.info>
 
        * gdk/win32/gdkfont-win32.c (gdk_font_load_internal): Match
index f47f1eb3ff2e8c79a50a6b8138039ec5ac5f5e14..68785b446445780297702b3f18dc1b15547a32f8 100644 (file)
@@ -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);