diff --git a/lib/editor/tinymce/extra/strings.php b/lib/editor/tinymce/extra/strings.php index 8fa0f739fa7..852d2ec314b 100644 --- a/lib/editor/tinymce/extra/strings.php +++ b/lib/editor/tinymce/extra/strings.php @@ -32,11 +32,7 @@ require_once('../../../../config.php'); $lang = optional_param('elanguage', 'en', PARAM_SAFEDIR); $theme = optional_param('etheme', 'advanced', PARAM_SAFEDIR); -if ($lang === 'en') { - //ok -} else if (file_exists($CFG->langotherroot .'/'. $lang)) { - //$lang = $lang; -} else { +if (!get_string_manager()->translation_exists($lang, false)) { $lang = 'en'; } diff --git a/lib/editor/tinymce/plugins/dragmath/dragmath.php b/lib/editor/tinymce/plugins/dragmath/dragmath.php index 8fae2ca861f..e968890b292 100644 --- a/lib/editor/tinymce/plugins/dragmath/dragmath.php +++ b/lib/editor/tinymce/plugins/dragmath/dragmath.php @@ -6,11 +6,10 @@ require("../../../../../config.php"); $lang = required_param('elanguage', PARAM_SAFEDIR); -if (file_exists("$CFG->dataroot/lang/$lang") or file_exists("$CFG->dirroot/lang/$lang")) { - $SESSION->lang = $lang; -} else if (file_exists("$CFG->dataroot/lang/{$lang}") or file_exists("$CFG->dirroot/lang/{$lang}")) { - $SESSION->lang = $lang; +if (!get_string_manager()->translation_exists($lang, false)) { + $lang = 'en'; } +$SESSION->lang = $lang; $langmapping = array('cs'=>'cz', 'pt_br'=>'pt-br');