summaryrefslogtreecommitdiff
path: root/program/include/rcmail.php
diff options
context:
space:
mode:
Diffstat (limited to 'program/include/rcmail.php')
-rw-r--r--program/include/rcmail.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index a927b7946..e297b24bc 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -1774,17 +1774,20 @@ class rcmail extends rcube
return;
}
- $lang = strtolower($_SESSION['language']);
+ $lang_codes = array($_SESSION['language']);
- // TinyMCE uses two-letter lang codes, with exception of Chinese
- if (strpos($lang, 'zh_') === 0) {
- $lang = str_replace('_', '-', $lang);
+ if ($pos = strpos($_SESSION['language'], '_')) {
+ $lang_codes[] = substr($_SESSION['language'], 0, $pos);
}
- else {
- $lang = substr($lang, 0, 2);
+
+ foreach ($lang_codes as $code) {
+ if (file_exists(INSTALL_PATH . 'program/js/tinymce/langs/'.$code.'.js')) {
+ $lang = $code;
+ break;
+ }
}
- if (!file_exists(INSTALL_PATH . 'program/js/tiny_mce/langs/'.$lang.'.js')) {
+ if (empty($lang)) {
$lang = 'en';
}
@@ -1796,7 +1799,7 @@ class rcmail extends rcube
'spelldict' => intval($this->config->get('spellcheck_dictionary'))
));
- $this->output->include_script('tiny_mce/tiny_mce.js');
+ $this->output->include_script('tinymce/tinymce.min.js');
$this->output->include_script('editor.js');
$this->output->add_script("rcmail_editor_init($script)", 'docready');
}
@@ -1830,8 +1833,8 @@ class rcmail extends rcube
);
foreach ($emoticons as $idx => $file) {
- // <img title="Cry" src="http://.../program/js/tiny_mce/plugins/emotions/img/smiley-cry.gif" border="0" alt="Cry" />
- $search[] = '/<img title="[a-z ]+" src="https?:\/\/[a-z0-9_.\/-]+\/tiny_mce\/plugins\/emotions\/img\/'.$file.'.gif"[^>]+\/>/i';
+ // <img title="Cry" src="http://.../program/js/tinymce/plugins/emoticons/img/smiley-cry.gif" border="0" alt="Cry" />
+ $search[] = '/<img title="[a-z ]+" src="https?:\/\/[a-z0-9_.\/-]+\/tinymce\/plugins\/emoticons\/img\/'.$file.'.gif"[^>]+\/>/i';
$replace[] = $idx;
}