summaryrefslogtreecommitdiff
path: root/program/include/rcmail_output_html.php
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-05-07 17:27:05 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-05-07 17:27:05 +0200
commit184ed2efe2258579c886de337446fcbb05f5faf4 (patch)
tree3a0569ad1e5c30f7918dc0001cf293d2ebbb89ea /program/include/rcmail_output_html.php
parentd2bf33b242e9578fcb05bbf1365eeaf1d0dac67c (diff)
Declare content language for proper text-to-speech support
Diffstat (limited to 'program/include/rcmail_output_html.php')
-rw-r--r--program/include/rcmail_output_html.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php
index a57165f03..ff660a4df 100644
--- a/program/include/rcmail_output_html.php
+++ b/program/include/rcmail_output_html.php
@@ -1332,6 +1332,15 @@ EOF;
$this->pagetitle = 'Roundcube Mail';
}
+ // declare page language
+ if (!empty($_SESSION['language'])) {
+ $lang = substr($_SESSION['language'], 0, 2);
+ $output = preg_replace('/<html/', '<html lang="' . html::quote($lang) . '"', $output, 1);
+ if (!headers_sent()) {
+ header('Content-Language: ' . $lang);
+ }
+ }
+
// replace specialchars in content
$page_title = html::quote($this->pagetitle);
$page_header = '';