[PATCH]Get rid off the duplicated localizated context menu items.



Hi,
In locales other than C, context menu items from bonobo server, which
with localized strings, will be duplicated. Here is a patch to fix it.

Regards
James Su
--- nautilus-2.2.1/src/file-manager/fm-directory-view.c.old	2003-02-18 17:27:03.000000000 +0800
+++ nautilus-2.2.1/src/file-manager/fm-directory-view.c	2003-02-18 17:24:23.000000000 +0800
@@ -3661,12 +3661,15 @@
 
 		verb = l->data;
 
-		prop_name = g_strdup_printf ("nautilusverb:%s", verb);
-		label = bonobo_server_info_prop_lookup (info, prop_name,
+		/* Get rid off the duplicated localizated strings */
+		if (strchr (verb, '-') == NULL) {
+			prop_name = g_strdup_printf ("nautilusverb:%s", verb);
+			label = bonobo_server_info_prop_lookup (info, prop_name,
 							langs_cpy);
-		g_free (prop_name);
+			g_free (prop_name);
 
-		g_string_append_printf (ui_xml, "<cmd name=\"%s\" label=\"%s\"/>", verb, label);
+			g_string_append_printf (ui_xml, "<cmd name=\"%s\" label=\"%s\"/>", verb, label);
+		}
 	}
 
 	g_slist_free (langs_cpy);
@@ -3677,7 +3680,9 @@
 	for (l = verb_names; l; l = l->next) {
 		char *verb = l->data;
 
-		g_string_append_printf (ui_xml, "<menuitem name=\"%s\" verb=\"%s\"/>", verb, verb);
+		/* Get rid off the duplicated localizated strings */
+		if (strchr (verb, '-') == NULL)
+			g_string_append_printf (ui_xml, "<menuitem name=\"%s\" verb=\"%s\"/>", verb, verb);
 	}
 	
 	ui_xml = g_string_append (ui_xml, "</placeholder></popup></popups></Root>");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]