$strchecklanguage -> $strmissingstrings"; break; case "compare": $navigation = "$strchecklanguage -> $strcomparelanguage"; break; default: $navigation = $strchecklanguage; break; } print_header("$site->fullname", "$site->fullname", "$stradministration -> $navigation"); if (!$mode) { print_heading("$strcurrentlanguage: $CFG->lang"); print_heading("$strmissingstrings"); print_heading("$strcomparelanguage"); print_footer(); exit; } if ($CFG->lang == "en") { notice("Nothing to check - you are using the English language pack!", "lang.php"); } // Get a list of all the root files in the English directory $langdir = "$CFG->dirroot/lang/$CFG->lang"; $enlangdir = "$CFG->dirroot/lang/en"; if (! $stringfiles = get_directory_list($enlangdir, "", false)) { error("Could not find English language pack!"); } foreach ($stringfiles as $key => $file) { if ($file == "README" or $file == "help" or $file == "docs") { unset($stringfiles[$key]); } } if ($mode == "missing") { // For each file, check that a counterpart exists, then check all the strings foreach ($stringfiles as $file) { if (!file_exists("$langdir/$file")) { echo "
".get_string("filemissing", "", "$langdir/$file")."
"; continue; } unset($string); include("$enlangdir/$file"); $enstring = $string; unset($string); include("$langdir/$file"); $first = true; foreach ($enstring as $key => $value) { if (!isset($string[$key])) { $value = htmlentities($value); $value = str_replace("$"."a", "\\$"."a", $value); if ($first) { echo "".get_string("stringsnotset","","$langdir/$file")."
";
$first = false;
$somethingfound = true;
}
echo "$"."string[$key] = \"$value\";
";
}
}
}
closedir($dir);
if (! $files = get_directory_list("$CFG->dirroot/lang/en/help", "CVS")) {
error("Could not find English language help files!");
}
foreach ($files as $filekey => $file) { // check all the help files.
if (!file_exists("$langdir/help/$file")) {
echo "".get_string("filemissing", "", "$langdir/help/$file")."
";
$somethingfound = true;
continue;
}
}
if (! $files = get_directory_list("$CFG->dirroot/lang/en/docs", "CVS")) {
error("Could not find English language docs files!");
}
foreach ($files as $filekey => $file) { // check all the docs files.
if (!file_exists("$langdir/docs/$file")) {
echo "".get_string("filemissing", "", "$langdir/docs/$file")."
";
$somethingfound = true;
continue;
}
}
if ($somethingfound) {
print_continue("lang.php");
} else {
notice(get_string("languagegood"), "lang.php");
}
} else if ($mode == "compare") {
foreach ($stringfiles as $file) {
print_heading("$file", "LEFT", 4);
if (!file_exists("$langdir/$file")) {
echo "".get_string("filemissing", "", "$langdir/$file")."
";
continue;
}
unset($string);
include("$enlangdir/$file");
$enstring = $string;
unset($string);
include("$langdir/$file");
echo "| $key | "; echo "$value | "; if (isset($string[$key])) { $value = htmlentities($string[$key]); $value = str_replace("$"."a", "\\$"."a", $value); echo "$value | "; } else { echo "- | "; } } echo "