From d362be429cf05a0e7aaa0582d55dbd97c4616256 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Fri, 24 Sep 2004 04:23:29 +0000 Subject: ** See bug #65329. 2004-09-20 Not Zed ** 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. svn path=/trunk/; revision=27359 --- mail/em-folder-tree-model.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'mail/em-folder-tree-model.c') diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index 15be6d5cfb..da31fd4c12 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -414,6 +414,15 @@ account_removed (EAccountList *accounts, EAccount *account, gpointer user_data) 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,6 +436,7 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite 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 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite } 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, -- cgit