From a37d399b037fbcfef1f3ef4cb932ee9905f8d0f1 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Fri, 28 Feb 2020 14:58:12 +1300 Subject: [PATCH] Fix #455 - Fix some hard-coded language strings. --- export.php | 4 +++- lang/en/attendance.php | 1 + locallib.php | 2 +- renderer.php | 12 ++++++++++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/export.php b/export.php index fabb0d5..df6eaa3 100644 --- a/export.php +++ b/export.php @@ -79,7 +79,9 @@ if ($formdata = $mform->get_data()) { $reportdata = new attendance_report_data($att); if ($reportdata->users) { - $filename = clean_filename($course->shortname.'_Attendances_'.userdate(time(), '%Y%m%d-%H%M')); + $filename = clean_filename($course->shortname.'_'. + get_string('modulenameplural', 'attendance'). + '_'.userdate(time(), '%Y%m%d-%H%M')); $group = $formdata->group ? $reportdata->groups[$formdata->group] : 0; $data = new stdClass; diff --git a/lang/en/attendance.php b/lang/en/attendance.php index 62357f5..aabf1b8 100644 --- a/lang/en/attendance.php +++ b/lang/en/attendance.php @@ -325,6 +325,7 @@ $string['oversessionstaken_help'] = 'Shows statistics for sessions where attenda
  • Points: points awarded based on the taken sessions.
  • Percentage: percentage of points awarded over the maxium possible points of the taken sessions.
  • '; +$string['pageof'] = 'Page {$a->page} of {$a->numpages}'; $string['participant'] = 'Participant'; $string['password'] = 'Password'; $string['enterpassword'] = 'Enter password'; diff --git a/locallib.php b/locallib.php index 597fb06..ae4ca63 100644 --- a/locallib.php +++ b/locallib.php @@ -518,7 +518,7 @@ function attendance_exporttotableed($data, $filename, $format) { // Sending HTTP headers. $workbook->send($filename); // Creating the first worksheet. - $myxls = $workbook->add_worksheet('Attendances'); + $myxls = $workbook->add_worksheet(get_string('modulenameplural', 'attendance')); // Format types. $formatbc = $workbook->add_format(); $formatbc->set_bold(1); diff --git a/renderer.php b/renderer.php index 7143676..c543e40 100644 --- a/renderer.php +++ b/renderer.php @@ -129,7 +129,11 @@ class mod_attendance_renderer extends plugin_renderer_base { 'page' => $fcontrols->pageparams->page - 1)), $this->output->larrow()); } - $pagingcontrols .= html_writer::tag('span', "Page {$fcontrols->pageparams->page} of $numberofpages", + $a = new stdClass(); + $a->page = $fcontrols->pageparams->page; + $a->numpages = $numberofpages; + $text = get_string('pageof', 'attendance', $a); + $pagingcontrols .= html_writer::tag('span', $text, array('class' => 'attbtn')); if ($fcontrols->pageparams->page < $numberofpages) { $pagingcontrols .= html_writer::link($fcontrols->url(array('curdate' => $fcontrols->curdate, @@ -532,7 +536,11 @@ class mod_attendance_renderer extends plugin_renderer_base { $controls .= html_writer::link($takedata->url(array('page' => $takedata->pageparams->page - 1)), $this->output->larrow()); } - $controls .= html_writer::tag('span', "Page {$takedata->pageparams->page} of $numberofpages", + $a = new stdClass(); + $a->page = $takedata->pageparams->page; + $a->numpages = $numberofpages; + $text = get_string('pageof', 'attendance', $a); + $controls .= html_writer::tag('span', $text, array('class' => 'attbtn')); if ($takedata->pageparams->page < $numberofpages) { $controls .= html_writer::link($takedata->url(array('page' => $takedata->pageparams->page + 1,