Index: bonobo/bonobo-ui-util.c
===================================================================
RCS file: /cvs/gnome/libbonoboui/bonobo/bonobo-ui-util.c,v
retrieving revision 1.88
diff -u -r1.88 bonobo-ui-util.c
--- bonobo/bonobo-ui-util.c	25 Sep 2004 18:51:11 -0000	1.88
+++ bonobo/bonobo-ui-util.c	19 Apr 2005 12:12:00 -0000
@@ -703,6 +703,21 @@
 void
 bonobo_ui_util_translate_ui (BonoboUINode *node)
 {
+	bonobo_ui_util_translate_ui_with_domain (node, NULL);
+}
+
+/**
+ * bonobo_ui_util_translate_ui:
+ * @node: the node to start at.
+ * @domain: the translation domain
+ * 
+ *  Quest through a tree looking for translatable properties
+ * ( those prefixed with an '_' ). Translates the value of the
+ * property according to the domain and removes the leading '_'.
+ **/
+void
+bonobo_ui_util_translate_ui_with_domain (BonoboUINode *node, const char *domain)
+{
         BonoboUINode *l;
 	int           i;
 
@@ -726,7 +741,7 @@
 
 			old = a->value;
 #ifdef ENABLE_NLS
-			a->value = xmlStrdup (gettext(a->value));
+			a->value = xmlStrdup (domain ? dgettext (domain, a->value) : gettext(a->value));
 #else
 			a->value = xmlStrdup (a->value);
 #endif
@@ -735,7 +750,7 @@
 	}
 
 	for (l = node->children; l; l = l->next)
-		bonobo_ui_util_translate_ui (l);
+		bonobo_ui_util_translate_ui_with_domain (l, domain);
 }
 
 /**
@@ -844,6 +859,29 @@
 		       const char        *app_prefix,
 		       const char        *app_name)
 {
+	return bonobo_ui_util_new_ui_with_domain (component, file_name, app_prefix, app_name, NULL);
+}
+
+/**
+ * bonobo_ui_util_new_ui_with_domain:
+ * @component: The component help callback should be on
+ * @file_name: Filename of the UI file
+ * @app_name: Application name ( for finding help )
+ * @domain: Translation domain
+ * 
+ *  Loads an xml tree from a file, cleans the 
+ * doc cruft from its nodes; and translates the nodes
+ * according to the domain.
+ * 
+ * Return value: The translated tree ready to be merged.
+ **/
+BonoboUINode *
+bonobo_ui_util_new_ui_with_domain  (BonoboUIComponent *component,
+				    const char        *file_name,
+				    const char        *app_prefix,
+				    const char        *app_name,
+				    const char        *domain)
+{
 	BonoboUINode *node;
 
 	g_return_val_if_fail (app_name != NULL, NULL);
@@ -851,7 +889,7 @@
 
         node = bonobo_ui_node_from_file (file_name);
 
-	bonobo_ui_util_translate_ui (node);
+	bonobo_ui_util_translate_ui_with_domain (node, domain);
 
 	bonobo_ui_util_fixup_help (component, node, app_prefix, app_name);
 
Index: bonobo/bonobo-ui-util.h
===================================================================
RCS file: /cvs/gnome/libbonoboui/bonobo/bonobo-ui-util.h,v
retrieving revision 1.27
diff -u -r1.27 bonobo-ui-util.h
--- bonobo/bonobo-ui-util.h	2 Apr 2002 15:22:20 -0000	1.27
+++ bonobo/bonobo-ui-util.h	19 Apr 2005 12:12:00 -0000
@@ -33,6 +33,8 @@
 					       const char        *file_name);
 
 void       bonobo_ui_util_translate_ui        (BonoboUINode      *node);
+void       bonobo_ui_util_translate_ui_with_domain (BonoboUINode      *node,
+						    const char        *domain);
 
 void       bonobo_ui_util_fixup_help          (BonoboUIComponent *component,
 					       BonoboUINode      *node,
@@ -48,6 +50,11 @@
 					     const char        *fname,
 					     const char        *app_prefix,
 					     const char        *app_name);
+BonoboUINode   *bonobo_ui_util_new_ui_with_domain (BonoboUIComponent *component,
+						   const char        *fname,
+						   const char        *app_prefix,
+						   const char        *app_name,
+						   const char        *domain);
 
 void            bonobo_ui_util_set_ui       (BonoboUIComponent *component,
 					     const char        *app_prefix,
