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.
This commit is contained in:
Tor Lillqvist 2005-04-22 07:35:37 +00:00 committed by Tor Lillqvist
parent e41ade967e
commit 474ddd204a
4 changed files with 47 additions and 9 deletions

View 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

View 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

View 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

View 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);