summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2008-02-19 23:09:20 +0000
committerthomascube <thomas@roundcube.net>2008-02-19 23:09:20 +0000
commitfed22fd23257ac86ae9c7f1dbea1d538a0f0dee7 (patch)
tree09b6545fb5cd1ae95e6249404385d2c320058c68 /program
parent3549785897093452a5c523e517ac42842bea694d (diff)
Localize folder name in page title (#1484785)
Diffstat (limited to 'program')
-rw-r--r--program/include/main.inc16
-rw-r--r--program/steps/mail/func.inc2
2 files changed, 17 insertions, 1 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index 2d28090c7..06cf706ea 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -1844,4 +1844,20 @@ function rcmail_folder_classname($folder_id)
}
+/**
+ * Try to localize the given IMAP folder name.
+ * UTF-7 decode it in case no localized text was found
+ *
+ * @param string Folder name
+ * @return string Localized folder name in UTF-8 encoding
+ */
+function rcmail_localize_foldername($name)
+{
+ if ($folder_class = rcmail_folder_classname($name))
+ return rcube_label($folder_class);
+ else
+ return rcube_charset_convert($name, 'UTF-7');
+}
+
+
?>
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 5156e0232..f14c532b4 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -76,7 +76,7 @@ if (!$OUTPUT->ajax_call)
// set page title
if (empty($_action) || $_action == 'list')
- $OUTPUT->set_pagetitle(rcube_charset_convert($IMAP->get_mailbox_name(), 'UTF-7'));
+ $OUTPUT->set_pagetitle(rcmail_localize_foldername($IMAP->get_mailbox_name()));