Commit a5130581 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

removed "translation-domain" property and simply use gettext(). Plug-In

2004-04-27  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpactiongroup.[ch]: removed "translation-domain"
	property and simply use gettext(). Plug-In domains are handled
	by plug-in-actions.c

	The following change finally starts breaking the old menu system
	while the new one is not fully in place yet. Have fun:

	* menus/image-menu.xml: added several <placeholder>s for plug-ins
	to register their menu entries in the middle of already existing
	menus.

	* app/gui/menus.c
	* plug-ins/common/mail.c
	* plug-ins/print/print.c
	* plug-ins/script-fu/scripts/copy-visible.scm: use the new
	placeholders to register menu entries.
parent 4e8105c1
2004-04-27 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpactiongroup.[ch]: removed "translation-domain"
property and simply use gettext(). Plug-In domains are handled
by plug-in-actions.c
The following change finally starts breaking the old menu system
while the new one is not fully in place yet. Have fun:
* menus/image-menu.xml: added several <placeholder>s for plug-ins
to register their menu entries in the middle of already existing
menus.
* app/gui/menus.c
* plug-ins/common/mail.c
* plug-ins/print/print.c
* plug-ins/script-fu/scripts/copy-visible.scm: use the new
placeholders to register menu entries.
2004-04-27 Michael Natterer <mitch@gimp.org>
Correctly translated & sorted plug-in actions & menu entries:
......
......@@ -479,7 +479,7 @@ menus_open_recent_add (GimpUIManager *manager,
gchar *action_path;
action_name = g_strdup_printf ("file-open-recent-%02d", i + 1);
action_path = g_strdup_printf ("%s/file-menu/file-open-recent-menu/file-open-recent-placeholder",
action_path = g_strdup_printf ("%s/File/Open Recent/file-open-recent-placeholder",
ui_path);
gtk_ui_manager_add_ui (GTK_UI_MANAGER (manager), merge_id,
......
......@@ -479,7 +479,7 @@ menus_open_recent_add (GimpUIManager *manager,
gchar *action_path;
action_name = g_strdup_printf ("file-open-recent-%02d", i + 1);
action_path = g_strdup_printf ("%s/file-menu/file-open-recent-menu/file-open-recent-placeholder",
action_path = g_strdup_printf ("%s/File/Open Recent/file-open-recent-placeholder",
ui_path);
gtk_ui_manager_add_ui (GTK_UI_MANAGER (manager), merge_id,
......
......@@ -41,8 +41,7 @@
enum
{
PROP_0,
PROP_GIMP,
PROP_TRANSLATION_DOMAIN
PROP_GIMP
};
......@@ -53,7 +52,6 @@ static GObject * gimp_action_group_constructor (GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_action_group_dispose (GObject *object);
static void gimp_action_group_finalize (GObject *object);
static void gimp_action_group_set_property (GObject *object,
guint prop_id,
const GValue *value,
......@@ -104,7 +102,6 @@ gimp_action_group_class_init (GimpActionGroupClass *klass)
object_class->constructor = gimp_action_group_constructor;
object_class->dispose = gimp_action_group_dispose;
object_class->finalize = gimp_action_group_finalize;
object_class->set_property = gimp_action_group_set_property;
object_class->get_property = gimp_action_group_get_property;
......@@ -115,13 +112,6 @@ gimp_action_group_class_init (GimpActionGroupClass *klass)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_TRANSLATION_DOMAIN,
g_param_spec_string ("translation-domain",
NULL, NULL,
NULL,
G_PARAM_READWRITE));
klass->groups = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
}
......@@ -129,7 +119,7 @@ gimp_action_group_class_init (GimpActionGroupClass *klass)
static void
gimp_action_group_init (GimpActionGroup *group)
{
group->translation_domain = NULL;
group->gimp = NULL;
}
static GObject *
......@@ -162,20 +152,6 @@ gimp_action_group_constructor (GType type,
return object;
}
static void
gimp_action_group_finalize (GObject *object)
{
GimpActionGroup *group = GIMP_ACTION_GROUP (object);
if (group->translation_domain)
{
g_free (group->translation_domain);
group->translation_domain = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gimp_action_group_dispose (GObject *object)
{
......@@ -220,10 +196,6 @@ gimp_action_group_set_property (GObject *object,
case PROP_GIMP:
group->gimp = g_value_get_object (value);
break;
case PROP_TRANSLATION_DOMAIN:
g_free (group->translation_domain);
group->translation_domain = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -243,9 +215,6 @@ gimp_action_group_get_property (GObject *object,
case PROP_GIMP:
g_value_set_object (value, group->gimp);
break;
case PROP_TRANSLATION_DOMAIN:
g_value_set_string (value, group->translation_domain);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -326,8 +295,8 @@ gimp_action_group_add_actions (GimpActionGroup *group,
const gchar *label;
const gchar *tooltip;
label = dgettext (group->translation_domain, entries[i].label);
tooltip = dgettext (group->translation_domain, entries[i].tooltip);
label = gettext (entries[i].label);
tooltip = gettext (entries[i].tooltip);
action = gtk_action_new (entries[i].name, label, tooltip,
entries[i].stock_id);
......@@ -360,8 +329,8 @@ gimp_action_group_add_toggle_actions (GimpActionGroup *group,
const gchar *label;
const gchar *tooltip;
label = dgettext (group->translation_domain, entries[i].label);
tooltip = dgettext (group->translation_domain, entries[i].tooltip);
label = gettext (entries[i].label);
tooltip = gettext (entries[i].tooltip);
action = gtk_toggle_action_new (entries[i].name, label, tooltip,
entries[i].stock_id);
......@@ -400,8 +369,8 @@ gimp_action_group_add_radio_actions (GimpActionGroup *group,
const gchar *label;
const gchar *tooltip;
label = dgettext (group->translation_domain, entries[i].label);
tooltip = dgettext (group->translation_domain, entries[i].tooltip);
label = gettext (entries[i].label);
tooltip = gettext (entries[i].tooltip);
action = gtk_radio_action_new (entries[i].name, label, tooltip,
entries[i].stock_id,
......@@ -445,8 +414,8 @@ gimp_action_group_add_enum_actions (GimpActionGroup *group,
const gchar *label;
const gchar *tooltip;
label = dgettext (group->translation_domain, entries[i].label);
tooltip = dgettext (group->translation_domain, entries[i].tooltip);
label = gettext (entries[i].label);
tooltip = gettext (entries[i].tooltip);
action = gimp_enum_action_new (entries[i].name, label, tooltip,
entries[i].stock_id,
......@@ -481,8 +450,8 @@ gimp_action_group_add_string_actions (GimpActionGroup *group,
const gchar *label;
const gchar *tooltip;
label = dgettext (group->translation_domain, entries[i].label);
tooltip = dgettext (group->translation_domain, entries[i].tooltip);
label = gettext (entries[i].label);
tooltip = gettext (entries[i].tooltip);
action = gimp_string_action_new (entries[i].name, label, tooltip,
entries[i].stock_id,
......
......@@ -40,7 +40,6 @@ struct _GimpActionGroup
GtkActionGroup parent_instance;
Gimp *gimp;
gchar *translation_domain;
GimpActionGroupUpdateFunc update_func;
};
......
......@@ -15,11 +15,14 @@
<menu action="file-acquire-menu" name="Acquire">
</menu>
<separator />
<menuitem action="file-save" />
<menuitem action="file-save-as" />
<menuitem action="file-save-a-copy" />
<menuitem action="file-save-as-template" />
<menuitem action="file-revert" />
<placeholder name="Save">
<menuitem action="file-save" />
<menuitem action="file-save-as" />
<menuitem action="file-save-a-copy" />
<menuitem action="file-save-as-template" />
<menuitem action="file-revert" />
<separator />
</placeholder>
<separator />
<menuitem action="file-close" />
<menuitem action="file-quit" />
......@@ -30,11 +33,17 @@
<menuitem action="edit-redo" />
<menuitem action="dialogs-undo-history" />
<separator />
<menuitem action="edit-cut" />
<menuitem action="edit-copy" />
<menuitem action="edit-paste" />
<menuitem action="edit-paste-into" />
<menuitem action="edit-paste-as-new" />
<placeholder name="Cut">
<menuitem action="edit-cut" />
</placeholder>
<placeholder name="Copy">
<menuitem action="edit-copy" />
</placeholder>
<placeholder name="Paste">
<menuitem action="edit-paste" />
<menuitem action="edit-paste-into" />
<menuitem action="edit-paste-as-new" />
</placeholder>
<menu action="edit-buffer-menu" name="Buffer">
<menuitem action="edit-named-cut" />
<menuitem action="edit-named-copy" />
......
......@@ -211,7 +211,7 @@ query (void)
"Adrian Likins, Reagan Blundell",
"Adrian Likins, Reagan Blundell, Daniel Risacher, Spencer Kimball and Peter Mattis",
"1995-1997",
N_("<Image>/File/_Mail Image..."),
N_("<Image>/File/Save/_Mail Image..."),
"RGB*, GRAY*, INDEXED*",
GIMP_PLUGIN,
G_N_ELEMENTS (args), 0,
......
......@@ -161,7 +161,7 @@ query (void)
gimp_install_procedure ("file_print_gimp",
blurb, help, auth, copy,
PLUG_IN_VERSION,
N_("<Image>/File/_Print..."),
N_("<Image>/File/Save/_Print..."),
types,
GIMP_PLUGIN,
G_N_ELEMENTS (args), 0,
......
......@@ -66,7 +66,7 @@
(gimp-image-delete image)))
(script-fu-register "script-fu-copy-visible"
_"<Image>/Edit/Copy _Visible"
_"<Image>/Edit/Copy/Copy _Visible"
"Copy the visible selection"
"Sven Neumann <sven@gimp.org>, Adrian Likins <adrian@gimp.org>, Raphael Quinet <raphael@gimp.org>"
"Sven Neumann, Adrian Likins, Raphael Quinet"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment