mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-30306 get_string developer warning. Help lazy developers.
This commit is contained in:
parent
6be90ce05f
commit
fc2dafcff5
@ -6213,7 +6213,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]]";
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user