/// First check all the normal locations for the string in the current language
foreach ($locations as $location) {
- $langfile = $location.'/'.$lang.'/'.$module.'.php';
+ $langfile = $location.$lang.'/'.$module.'.php';
if (file_exists($langfile)) {
if ($result = get_string_from_file($identifier, $langfile, "\$resultstring")) {
eval($result);
/// Is a parent language defined? If so, try to find this string in a parent language file
foreach ($locations as $location) {
- $langfile = $location.'/'.$lang.'/moodle.php';
- if ($result = get_string_from_file('parentlanguage', $langfile, "\$parentlang")) {
- eval($result);
- if (!empty($parentlang)) { // found it!
- $langfile = $location.'/'.$parentlang.'/'.$module.'.php';
- if (file_exists($langfile)) {
- if ($result = get_string_from_file($identifier, $langfile, "\$resultstring")) {
- eval($result);
- return $resultstring;
+ $langfile = $location.$lang.'/moodle.php';
+ if (file_exists($langfile)) {
+ if ($result = get_string_from_file('parentlanguage', $langfile, "\$parentlang")) {
+ eval($result);
+ if (!empty($parentlang)) { // found it!
+ $langfile = $location.$parentlang.'/'.$module.'.php';
+ if (file_exists($langfile)) {
+ if ($result = get_string_from_file($identifier, $langfile, "\$resultstring")) {
+ eval($result);
+ return $resultstring;
+ }
}
}
}
/// Our only remaining option is to try English
foreach ($locations as $location) {
- $langfile = $location.'/en/'.$module.'.php';
+ $langfile = $location.'en/'.$module.'.php';
if (file_exists($langfile)) {
if ($result = get_string_from_file($identifier, $langfile, "\$resultstring")) {