MDL-65509 output: use translated strings when showing a fatal error

This commit is contained in:
Shamim Rezaie 2019-06-05 18:44:46 +10:00
parent dc468ac523
commit a875f3f513
2 changed files with 8 additions and 3 deletions

View File

@ -49,6 +49,7 @@ $string['nomodules'] = 'No modules found!!';
$string['nopageclass'] = 'Imported {$a} but found no page classes';
$string['noreports'] = 'No reports accessible';
$string['notables'] = 'No tables!';
$string['outputbuffer'] = 'Output buffer';
$string['phpvaroff'] = 'The PHP server variable \'{$a->name}\' should be Off - {$a->link}';
$string['phpvaron'] = 'The PHP server variable \'{$a->name}\' is not turned On - {$a->link}';
$string['sessionmissing'] = '{$a} object missing from session';

View File

@ -2809,16 +2809,20 @@ EOD;
$output .= $this->box($message, 'errorbox alert alert-danger', null, array('data-rel' => 'fatalerror'));
if ($CFG->debugdeveloper) {
$labelsep = get_string('labelsep', 'langconfig');
if (!empty($debuginfo)) {
$debuginfo = s($debuginfo); // removes all nasty JS
$debuginfo = str_replace("\n", '<br />', $debuginfo); // keep newlines
$output .= $this->notification('<strong>Debug info:</strong> '.$debuginfo, 'notifytiny');
$label = get_string('debuginfo', 'debug') . $labelsep;
$output .= $this->notification("<strong>$label</strong> " . $debuginfo, 'notifytiny');
}
if (!empty($backtrace)) {
$output .= $this->notification('<strong>Stack trace:</strong> '.format_backtrace($backtrace), 'notifytiny');
$label = get_string('stacktrace', 'debug') . $labelsep;
$output .= $this->notification("<strong>$label</strong> " . format_backtrace($backtrace), 'notifytiny');
}
if ($obbuffer !== '' ) {
$output .= $this->notification('<strong>Output buffer:</strong> '.s($obbuffer), 'notifytiny');
$label = get_string('outputbuffer', 'debug') . $labelsep;
$output .= $this->notification("<strong>$label</strong> " . s($obbuffer), 'notifytiny');
}
}