Commit 20454a9f authored by Vincent Geddes's avatar Vincent Geddes

Properly handle dgettext() operations (#453105, Christian Persch).

	* gladeui/glade-catalog.c: Properly handle dgettext() operations
	  (#453105, Christian Persch).

svn path=/trunk/; revision=1424
parent db681bf4
2007-07-02 Vincent Geddes <vgeddes@gnome.org>
* gladeui/glade-app.c: Revert last change. Do not free catalogs
in finalize as a result of #453105.
* gladeui/glade-catalog.c: Properly handle dgettext() operations
(#453105, Christian Persch).
2007-07-01 Vincent Geddes <vgeddes@gnome.org>
......
......@@ -189,8 +189,7 @@ glade_app_finalize (GObject *app)
g_free (locale_dir);
glade_binding_unload_all ();
/* FIXME: destroy catalogs */
glade_catalog_destroy_all ();
G_OBJECT_CLASS (glade_app_parent_class)->finalize (app);
}
......
......@@ -373,6 +373,7 @@ catalog_load_group (GladeCatalog *catalog, GladeXmlNode *group_node)
{
GladeWidgetGroup *group;
GladeXmlNode *node;
char *title, *translated_title;
group = g_slice_new0 (GladeWidgetGroup);
......@@ -386,9 +387,9 @@ catalog_load_group (GladeCatalog *catalog, GladeXmlNode *group_node)
return FALSE;
}
group->title = glade_xml_get_property_string (group_node,
GLADE_TAG_TITLE);
if (!group->title)
title = glade_xml_get_property_string (group_node,
GLADE_TAG_TITLE);
if (!title)
{
g_warning ("Required property 'title' not found in group node");
widget_group_destroy (group);
......@@ -399,9 +400,18 @@ catalog_load_group (GladeCatalog *catalog, GladeXmlNode *group_node)
group->expanded = TRUE;
/* Translate it */
group->title = dgettext (catalog->domain ?
catalog->domain : catalog->library,
group->title);
translated_title = dgettext (catalog->domain ?
catalog->domain : catalog->library,
title);
if (translated_title != title)
{
group->title = g_strdup (translated_title);
g_free (title);
}
else
{
group->title = title;
}
group->adaptors = NULL;
......
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