]> git.mjollnir.org Git - moodle.git/commitdiff
When getting a list of countries, check the parent language if necessary.
authormoodler <moodler>
Fri, 26 Sep 2003 08:21:11 +0000 (08:21 +0000)
committermoodler <moodler>
Fri, 26 Sep 2003 08:21:11 +0000 (08:21 +0000)
lib/moodlelib.php

index e5d29bb988f91bcd4c82e38eb26c6c1c5f8f8a3a..8a57b0350e639ea5c082c2f1c4896270cfbaaff1 100644 (file)
@@ -1291,7 +1291,15 @@ function get_list_of_countries() {
     $lang = current_language();
 
     if (!file_exists("$CFG->dirroot/lang/$lang/countries.php")) {
-        $lang = "en";  // countries.php must exist in this pack
+        if ($parentlang = get_string("parentlanguage")) {
+            if (file_exists("$CFG->dirroot/lang/$parentlang/countries.php")) {
+                $lang = $parentlang;
+            } else {
+                $lang = "en";  // countries.php must exist in this pack
+            }
+        } else {
+            $lang = "en";  // countries.php must exist in this pack
+        }
     }
 
     include("$CFG->dirroot/lang/$lang/countries.php");