}
}
- // If the preferred language was English we can abort now
+ // If it's a module, then look within the module pack itself mod/xxxx/lang/en/module.php
+
+ if ($module != "moodle") {
+ $modlangpath = "$CFG->dirroot/mod/$module/lang";
+ $langfile = "$modlangpath/$lang/$module.php";
+ if (file_exists($langfile)) {
+ if ($result = get_string_from_file($identifier, $langfile, "\$resultstring")) {
+ eval($result);
+ return $resultstring;
+ }
+ }
+ }
+ // If the preferred language was English we can abort now
if ($lang == "en") {
return "[[$identifier]]";
}
return $resultstring;
}
+ // If it's a module, then look within the module pack itself mod/xxxx/lang/en/module.php
+
+ if ($module != "moodle") {
+ $langfile = "$modlangpath/en/$module.php";
+ if (file_exists($langfile)) {
+ if ($result = get_string_from_file($identifier, $langfile, "\$resultstring")) {
+ eval($result);
+ return $resultstring;
+ }
+ }
+ }
+
return "[[$identifier]]"; // Last resort
}