From 8454afe8e6eed39fcde72e844463d3f8e03e10fc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 20 Dec 2004 16:05:25 +0000 Subject: [PATCH] Don't translate NULL messages. (#161789, Morten Welinder) 2004-12-20 Matthias Clasen * gtk/gtkactiongroup.c (gtk_action_group_translate_string): Don't translate NULL messages. (#161789, Morten Welinder) --- ChangeLog | 3 +++ ChangeLog.pre-2-10 | 3 +++ ChangeLog.pre-2-6 | 3 +++ ChangeLog.pre-2-8 | 3 +++ docs/reference/ChangeLog | 4 ++++ docs/reference/gtk/tmpl/gtkitemfactory.sgml | 11 +++++++---- gtk/gtkactiongroup.c | 3 +++ 7 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6fec83ea2f..6b13ff30b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-12-20 Matthias Clasen + * gtk/gtkactiongroup.c (gtk_action_group_translate_string): Don't + translate NULL messages. (#161789, Morten Welinder) + * gtk/gtkmessagedialog.c (setup_primary_label_font): Don't show the secondary label on show_all(). (#161707, Christian Persch) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 6fec83ea2f..6b13ff30b1 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2004-12-20 Matthias Clasen + * gtk/gtkactiongroup.c (gtk_action_group_translate_string): Don't + translate NULL messages. (#161789, Morten Welinder) + * gtk/gtkmessagedialog.c (setup_primary_label_font): Don't show the secondary label on show_all(). (#161707, Christian Persch) diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 6fec83ea2f..6b13ff30b1 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,8 @@ 2004-12-20 Matthias Clasen + * gtk/gtkactiongroup.c (gtk_action_group_translate_string): Don't + translate NULL messages. (#161789, Morten Welinder) + * gtk/gtkmessagedialog.c (setup_primary_label_font): Don't show the secondary label on show_all(). (#161707, Christian Persch) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 6fec83ea2f..6b13ff30b1 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,8 @@ 2004-12-20 Matthias Clasen + * gtk/gtkactiongroup.c (gtk_action_group_translate_string): Don't + translate NULL messages. (#161789, Morten Welinder) + * gtk/gtkmessagedialog.c (setup_primary_label_font): Don't show the secondary label on show_all(). (#161707, Christian Persch) diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index b87cf8cd86..8fc3f7a184 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,7 @@ +2004-12-20 Matthias Clasen + + * gtk/tmpl/gtkitemfactory.sgml: Document GtkTranslateFunc + 2004-12-17 Matthias Clasen * gdk/tmpl/x_interaction.sgml: Remove a no longer needed diff --git a/docs/reference/gtk/tmpl/gtkitemfactory.sgml b/docs/reference/gtk/tmpl/gtkitemfactory.sgml index 39a44ad4b1..1195901c39 100644 --- a/docs/reference/gtk/tmpl/gtkitemfactory.sgml +++ b/docs/reference/gtk/tmpl/gtkitemfactory.sgml @@ -31,12 +31,15 @@ As of GTK+ 2.4, #GtkItemFactory has been deprecated in favour of #GtkUIManager. - +The function used to translate messages in e.g. #GtkIconFactory +and #GtkActionGroup. -@path: -@func_data: -@Returns: +@path: The id of the message. In #GtkItemFactory this will be a path + from a #GtkItemFactoryEntry, in #GtkActionGroup, it will be a label + or tooltip from a #GtkActionEntry. +@func_data: user data passed in when registering the function +@Returns: the translated message diff --git a/gtk/gtkactiongroup.c b/gtk/gtkactiongroup.c index 803c5ef7c9..510f9c5c87 100644 --- a/gtk/gtkactiongroup.c +++ b/gtk/gtkactiongroup.c @@ -1076,6 +1076,9 @@ gtk_action_group_translate_string (GtkActionGroup *action_group, g_return_val_if_fail (GTK_IS_ACTION_GROUP (action_group), string); + if (string == NULL) + return NULL; + translate_func = action_group->private_data->translate_func; translate_data = action_group->private_data->translate_data;