From: Eloy Lafuente (stronk7) Date: Wed, 23 Nov 2011 00:18:00 +0000 (+0100) Subject: Merge branch 'MDL-30306b' of git://github.com/timhunt/moodle X-Git-Tag: v2.2.0-rc1~101 X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=commitdiff_plain;h=1316fc8af9f5ac5590e979ef455ce8f74296a463;hp=8ea233e7ad934eebd491d83f440ac5e943a981c2 Merge branch 'MDL-30306b' of git://github.com/timhunt/moodle --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 71ae951b076..26fc43cb365 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -6211,7 +6211,17 @@ class core_string_manager implements string_manager { } if (!isset($string[$identifier])) { // the string is still missing - should be fixed by developer - debugging("Invalid get_string() identifier: '$identifier' or component '$component'", DEBUG_DEVELOPER); + list($plugintype, $pluginname) = normalize_component($component); + if ($plugintype == 'core') { + $file = "lang/en/{$component}.php"; + } else if ($plugintype == 'mod') { + $file = "mod/{$pluginname}/lang/en/{$pluginname}.php"; + } else { + $path = get_plugin_directory($plugintype, $pluginname); + $file = "{$path}/lang/en/{$plugintype}_{$pluginname}.php"; + } + debugging("Invalid get_string() identifier: '{$identifier}' or component '{$component}'. " . + "Perhaps you are missing \$string['{$identifier}'] = ''; in {$file}?", DEBUG_DEVELOPER); return "[[$identifier]]"; } }