When getting a list of countries, check the parent language if necessary.

This commit is contained in:
moodler 2003-09-26 08:21:11 +00:00
parent 5833a6c8eb
commit aa3eb05096

View 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");