From: skodak Date: Tue, 24 Apr 2007 14:58:43 +0000 (+0000) Subject: MDL-9560 $CFG->langlist should accept both short (en) and long (en_utf8) names; merge... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=70b8a73e62f718e8ceb91d9a22591d1f4537b064;p=moodle.git MDL-9560 $CFG->langlist should accept both short (en) and long (en_utf8) names; merged from MODOLE_18_STABLE --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 36a167402b..543d66f062 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -4560,6 +4560,13 @@ function get_list_of_languages() { if (!empty($CFG->langlist)) { // use admin's list of languages $langlist = explode(',', $CFG->langlist); + // fix short lang names first - non existing langs are skipped anyway... + foreach ($langlist as $lang) { + if (strpos($lang, '_utf8') === false) { + $langlist[] = $lang.'_utf8'; + } + } + // find existing langs from langlist foreach ($langlist as $lang) { $lang = trim($lang); //Just trim spaces to be a bit more permissive if (strstr($lang, '_local')!==false) {