Some fixes for locales in a very multilibgual site (eg moodle.org)

This commit is contained in:
moodler
2004-06-21 12:39:31 +00:00
parent 734bdb63bf
commit 20761eb71d
3 changed files with 51 additions and 17 deletions
+1 -13
View File
@@ -224,20 +224,8 @@
if (empty($CFG->lang)) {
$CFG->lang = "en";
}
if (!empty($SESSION->lang) and ($SESSION->lang != $CFG->lang) ) {
$CFG->locale = get_string('locale');
} else if (!empty($USER->lang) and ($USER->lang != $CFG->lang) ) {
$CFG->locale = get_string('locale');
} else if (empty($CFG->locale)) {
$CFG->locale = get_string('locale');
set_config('locale', $CFG->locale); // cache it to save lookups in future
}
setlocale (LC_TIME, $CFG->locale);
setlocale (LC_COLLATE, $CFG->locale);
if ($CFG->locale != 'tr_TR') { // To workaround a well-known PHP bug with Turkish
setlocale (LC_CTYPE, $CFG->locale);
}
moodle_setlocale();
if (!empty($CFG->opentogoogle)) {
if (empty($_SESSION['USER'])) {