ximian bug #65329, translated standard mailbox names




A regression that came in a few months ago, the standard local mailbox names are no longer translated.

This is for gnome 2.8.1/evolution 2.0.1.

--
Michael Zucchi <notzed ximian com>
"born to die, live to work, it's all downhill from here"
Novell's Evolution and Free Software Developer

Attachment: zed-48.small.jpg
Description: Binary data

Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3444.2.9
diff -u -3 -r1.3444.2.9 ChangeLog
--- mail/ChangeLog	22 Sep 2004 01:31:16 -0000	1.3444.2.9
+++ mail/ChangeLog	23 Sep 2004 06:30:50 -0000
@@ -1,3 +1,14 @@
+2004-09-20  Not Zed  <NotZed Ximian com>
+
+	** See bug #65329.
+
+	* em-folder-tree-model.c (emft_is_special_local_folder): added
+	helper for finding local folders for translation.
+	(em_folder_tree_model_set_folder_info): translate the special
+	local folder names.
+
+	* mail-component.c: mark standard folder names for translation.
+
 2004-09-03  Not Zed  <NotZed Ximian com>
 
 	** See bug #65058.
Index: mail/em-folder-tree-model.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-tree-model.c,v
retrieving revision 1.61.4.1
diff -u -3 -r1.61.4.1 em-folder-tree-model.c
--- mail/em-folder-tree-model.c	21 Sep 2004 01:50:33 -0000	1.61.4.1
+++ mail/em-folder-tree-model.c	23 Sep 2004 06:30:51 -0000
@@ -414,6 +414,15 @@
 	em_folder_tree_model_remove_store (model, si->store);
 }
 
+/* NB: more-or-less copied from em-folder-tree.c */
+static gboolean
+emft_is_special_local_folder(CamelStore *store, const char *name)
+{
+	/* Bit of a hack to translate local mailbox names */
+	return store == mail_component_peek_local_store(NULL)
+		&& (!strcmp (name, "Drafts") || !strcmp (name, "Inbox")
+		    || !strcmp (name, "Outbox") || !strcmp (name, "Sent"));
+}
 
 void
 em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *iter,
@@ -427,7 +436,8 @@
 	gboolean load = FALSE;
 	struct _CamelFolder *folder;
 	gboolean emitted = FALSE;
-	
+	const char *name;
+
 	if (!fully_loaded)
 		load = fi->child == NULL && !(fi->flags & (CAMEL_FOLDER_NOCHILDREN | CAMEL_FOLDER_NOINFERIORS));
 	
@@ -457,9 +467,14 @@
 		}
 		camel_object_unref(folder);
 	}
-		
+
+	if (emft_is_special_local_folder(si->store, fi->full_name))
+		name = _(fi->name);
+	else
+		name = fi->name;
+
 	gtk_tree_store_set ((GtkTreeStore *) model, iter,
-			    COL_STRING_DISPLAY_NAME, fi->name,
+			    COL_STRING_DISPLAY_NAME, name,
 			    COL_POINTER_CAMEL_STORE, si->store,
 			    COL_STRING_FULL_NAME, fi->full_name,
 			    COL_STRING_URI, fi->uri,
Index: mail/mail-component.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-component.c,v
retrieving revision 1.96
diff -u -3 -r1.96 mail-component.c
--- mail/mail-component.c	26 Aug 2004 04:13:43 -0000	1.96
+++ mail/mail-component.c	23 Sep 2004 06:30:52 -0000
@@ -130,10 +130,11 @@
 	char *uri;
 	CamelFolder *folder;
 } mc_default_folders[] = {
-	{ "Inbox", },
-	{ "Drafts", },
-	{ "Outbox", },
-	{ "Sent", },
+	/* translators: standard local mailbox names */
+	{ N_("Inbox"), },
+	{ N_("Drafts"), },
+	{ N_("Outbox"), },
+	{ N_("Sent"), },
 	{ "Inbox", },		/* 'always local' inbox */
 };
 


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