- if (proto == MODEST_PROTOCOL_STORE_POP) {
- error_msg = g_strdup (_("emev_ni_ui_pop3_msg_recv_error"));
- } else if (proto == MODEST_PROTOCOL_STORE_IMAP) {
- TnyIterator *iter = tny_list_create_iterator (not_opened_headers);
- TnyHeader *header = TNY_HEADER (tny_iterator_get_current (iter));
- gchar *subject = tny_header_dup_subject (header);
- error_msg = g_strdup_printf (_("emev_ni_ui_imap_message_not_available_in_server"),
- subject);
- g_free (subject);
- g_object_unref (header);
- g_object_unref (iter);
- } else {
+ ModestProtocol *protocol;
+ ModestProtocolRegistry *protocol_registry;
+ TnyIterator *iter;
+ TnyHeader *header;
+ gchar *subject;
+
+ protocol_registry = modest_runtime_get_protocol_registry ();
+ iter = tny_list_create_iterator (not_opened_headers);
+ header = TNY_HEADER (tny_iterator_get_current (iter));
+ subject = tny_header_dup_subject (header);
+
+ protocol = modest_protocol_registry_get_protocol_by_type (protocol_registry, proto);
+ error_msg = modest_protocol_get_translation (protocol, MODEST_PROTOCOL_TRANSLATION_MSG_NOT_AVAILABLE, subject);
+ g_free (subject);
+ g_object_unref (header);
+ g_object_unref (iter);
+
+ if (error_msg == NULL) {
+ error_msg = g_strdup (_("mail_ni_ui_folder_get_msg_folder_error"));
+ }
+
+ if (modest_protocol_registry_protocol_type_has_tag (protocol_registry,
+ proto,
+ MODEST_PROTOCOL_REGISTRY_LOCAL_STORE_PROTOCOLS)) {