From: martin Date: Sat, 14 Sep 2002 03:43:24 +0000 (+0000) Subject: Can now specify current language on a per-user basis X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1a72314d0f05d0c9df5d387283ed5cac14d9c607;p=moodle.git Can now specify current language on a per-user basis --- diff --git a/lang/en/moodle.php b/lang/en/moodle.php index e288780982..e8b7caaafc 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -325,6 +325,7 @@ $string[people] = "People"; $string[personalprofile] = "Personal profile"; $string[phone] = "Phone"; $string[potentialteachers] = "Potential teachers"; +$string[preferredlanguage] = "Preferred language"; $string[preview] = "Preview"; $string[previeworchoose] = "Preview or choose a theme"; $string[question] = "Question"; diff --git a/lib/moodlelib.php b/lib/moodlelib.php index edc17c1652..50c4c90e55 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1517,6 +1517,23 @@ function get_string_from_file($identifier, $langfile, $destination) { } +function get_list_of_languages() { +/// Returns a list of language codes and their full names + global $CFG; + + if (!$langdirs = get_list_of_plugins("lang")) { + return false; + } + + foreach ($langdirs as $lang) { + include("$CFG->dirroot/lang/$lang/moodle.php"); + $languages[$lang] = $string["thislanguage"]." ($lang)"; + unset($string); + } + return $languages; +} + + /// ENCRYPTION //////////////////////////////////////////////// function rc4encrypt($data) { diff --git a/user/edit.html b/user/edit.html index 290527ff59..df49f26a0e 100644 --- a/user/edit.html +++ b/user/edit.html @@ -126,6 +126,18 @@ if (isadmin()) { + +

: + lang) { + $user->lang = "en"; + } + choose_from_menu ($languages, "lang", $user->lang, "", "", ""); + } + formerr($err["lang"]); + ?> + +

: