From aa3eb050964b354b0df2dee167c461ca0f635f40 Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 26 Sep 2003 08:21:11 +0000 Subject: [PATCH] When getting a list of countries, check the parent language if necessary. --- lib/moodlelib.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index e5d29bb988..8a57b0350e 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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"); -- 2.39.5