-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
4.3.3
-
MOODLE_403_STABLE
On the page `/report/eventlist/index.php`, it can be observed that the names of events that are part of Moodle `core` are not being translated. The previous code can be seen below:
// line 316
|
// report/eventlist/classes/list_generator.php
|
|
// Human readable plugin information to go with the component.
|
$pluginstring = explode('\\', $eventfullpath); |
if ($pluginstring[1] !== 'core') { |
$component = $eventdata[$eventfullpath]['component']; |
$manager = get_string_manager();
|
if ($manager->string_exists('pluginname', $pluginstring[1])) { |
$eventdata[$eventfullpath]['component'] = \html_writer::span(get_string('pluginname', $pluginstring[1])); |
}
|
}
|
My suggested code to fix this issue is as follows:
// Human readable plugin information to go with the component.
|
$pluginstring = explode('\\', $eventfullpath); |
if (!str_contains($pluginstring[1], 'core')) { <- edited! |
$component = $eventdata[$eventfullpath]['component']; |
$manager = get_string_manager();
|
if ($manager->string_exists('pluginname', $pluginstring[1])) { |
$eventdata[$eventfullpath]['component'] = \html_writer::span(get_string('pluginname', $pluginstring[1])); |
}
|
} else { <- created |
$component = $pluginstring[1]; |
if($component == 'core') $component = get_string('coresystem'); |
if( strpos($component, 'core_') !== false) $component = get_string(str_replace('core_', '', $component), $component); |
$eventdata[$eventfullpath]['component'] = \html_writer::span($component); |
}
|
- has been marked as being related by
-
MDL-70158 Make it easier to find a specific component in template library
- Closed
-
MDL-72500 Make it easier to find a specific component in event list report
- Closed
-
MDL-77260 Make it easier to find a specific component in event monitoring tool
- Closed
- is blocked by
-
MDL-82964 Report column callback for formatting plugin names
- Development in progress