Commit b71a4af9 authored by Yuliya Bozhko's avatar Yuliya Bozhko Committed by Gerrit Code Review
Browse files

Merge "Improving check for which tinymce lang to use (Bug #1319302)"

parents de8b1110 76739c40
......@@ -125,10 +125,14 @@ function smarty($javascript = array(), $headers = array(), $pagestrings = array(
$language = current_language();
$language = substr($language, 0, ((substr_count($language, '_') > 0) ? 5 : 2));
if ($language != 'en' && !file_exists(get_config('docroot') . 'js/tinymce/langs/' . $language . '.js')) {
// In case we fail to find a language of 5 chars, eg pt_BR (Portugese, Brazil) we try the 'parent' pt (Portugese)
$language = substr($language, 0, 2);
if ($language != 'en' && !file_exists(get_config('docroot') . 'js/tinymce/langs/' . $language . '.js')) {
$language = 'en';
// In case the language file exists as a string with both lower and upper case, eg fr_FR we test for this
$language = substr($language, 0, 2) . '_' . strtoupper(substr($language, 0, 2));
if (!file_exists(get_config('docroot') . 'js/tinymce/langs/' . $language . '.js')) {
// In case we fail to find a language of 5 chars, eg pt_BR (Portugese, Brazil) we try the 'parent' pt (Portugese)
$language = substr($language, 0, 2);
if ($language != 'en' && !file_exists(get_config('docroot') . 'js/tinymce/langs/' . $language . '.js')) {
$language = 'en';
}
}
}
$extrasetup = isset($extraconfig['tinymcesetup']) ? $extraconfig['tinymcesetup'] : '';
......
Markdown is supported
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