Commit c249c548 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Set the language of the WYSIWYG editor correctly, to support translations

parent 8c1e5567
...@@ -665,12 +665,14 @@ EOF; ...@@ -665,12 +665,14 @@ EOF;
// the execcommand_callback. // the execcommand_callback.
$content_css = json_encode(theme_get_url('style/tinymce.css')); $content_css = json_encode(theme_get_url('style/tinymce.css'));
$language = substr(get_config('lang'), 0, 2);
$tinymceinit = <<<EOF $tinymceinit = <<<EOF
<script type="text/javascript"> <script type="text/javascript">
tinyMCE.init({ tinyMCE.init({
mode: "textareas", mode: "textareas",
editor_selector: 'wysiwyg', editor_selector: 'wysiwyg',
button_tile_map: true, button_tile_map: true,
language: '{$language}',
theme: "advanced", theme: "advanced",
plugins: "table,emotions,iespell,inlinepopups", plugins: "table,emotions,iespell,inlinepopups",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,forecolor,backcolor,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,hr,emotions,iespell,cleanup,separator,link,unlink,image,separator,code", theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,forecolor,backcolor,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,hr,emotions,iespell,cleanup,separator,link,unlink,image,separator,code",
......
...@@ -79,12 +79,14 @@ function &smarty($javascript = array(), $headers = array(), $pagestrings = array ...@@ -79,12 +79,14 @@ function &smarty($javascript = array(), $headers = array(), $pagestrings = array
} }
else { else {
$content_css = json_encode(theme_get_url('style/tinymce.css')); $content_css = json_encode(theme_get_url('style/tinymce.css'));
$language = substr(get_config('lang'), 0, 2);
$headers[] = <<<EOF $headers[] = <<<EOF
<script type="text/javascript"> <script type="text/javascript">
tinyMCE.init({ tinyMCE.init({
mode: "textareas", mode: "textareas",
editor_selector: 'wysiwyg', editor_selector: 'wysiwyg',
button_tile_map: true, button_tile_map: true,
language: '{$language}',
theme: "advanced", theme: "advanced",
plugins: "table,emotions,iespell,inlinepopups,paste", plugins: "table,emotions,iespell,inlinepopups,paste",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,forecolor,backcolor,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,hr,emotions,iespell,cleanup,separator,link,unlink,separator,code", theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,forecolor,backcolor,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,hr,emotions,iespell,cleanup,separator,link,unlink,separator,code",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment