summaryrefslogtreecommitdiff
path: root/gladeui
diff options
context:
space:
mode:
authorVincent Geddes <vgeddes@src.gnome.org>2007-07-02 18:29:19 +0000
committerVincent Geddes <vgeddes@src.gnome.org>2007-07-02 18:29:19 +0000
commit20454a9f8c3fb4b390420828709b4022f1563b6e (patch)
tree2267fdabc648080e32d19dfe00e181647a44996b /gladeui
parentdb681bf4c9c3e894bcdf268eeccde79aeaa0136e (diff)
downloadglade-20454a9f8c3fb4b390420828709b4022f1563b6e.tar.gz
Properly handle dgettext() operations (#453105, Christian Persch).
* gladeui/glade-catalog.c: Properly handle dgettext() operations (#453105, Christian Persch). svn path=/trunk/; revision=1424
Diffstat (limited to 'gladeui')
-rw-r--r--gladeui/glade-app.c3
-rw-r--r--gladeui/glade-catalog.c22
2 files changed, 17 insertions, 8 deletions
diff --git a/gladeui/glade-app.c b/gladeui/glade-app.c
index 95167078..06270497 100644
--- a/gladeui/glade-app.c
+++ b/gladeui/glade-app.c
@@ -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);
}
diff --git a/gladeui/glade-catalog.c b/gladeui/glade-catalog.c
index 903a6be4..bea1f655 100644
--- a/gladeui/glade-catalog.c
+++ b/gladeui/glade-catalog.c
@@ -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;