MDL-41248 completion: fix non-translatable text.

There were two hard-coded strings. Thanks to Guido Hornig for the suggested fix.
This commit is contained in:
Tim Hunt 2014-02-25 16:29:13 +01:00
parent 76e4de31cc
commit 8d3debf360
2 changed files with 4 additions and 2 deletions

View File

@ -165,7 +165,7 @@ class completion_criteria_duration extends completion_criteria {
* @return string
*/
public function get_title_detailed() {
return ceil($this->enrolperiod / (60 * 60 * 24)) . ' days';
return get_string('xdays', 'completion', ceil($this->enrolperiod / (60 * 60 * 24)));
}
/**
@ -190,7 +190,8 @@ class completion_criteria_duration extends completion_criteria {
$daysleft = ceil($timeleft / (60 * 60 * 24));
return ($daysleft > 0 ? $daysleft : 0).' of '.$enrolperiod;
return get_string('daysoftotal', 'completion', array(
'days' => $daysleft > 0 ? $daysleft : 0, 'total' => $enrolperiod));
}
/**

View File

@ -111,6 +111,7 @@ $string['criteriarequiredany'] = 'Any criteria below are required';
$string['csvdownload'] = 'Download in spreadsheet format (UTF-8 .csv)';
$string['datepassed'] = 'Date passed';
$string['days'] = 'Days';
$string['daysoftotal'] = '{$a->days} of {$a->total}';
$string['deletecompletiondata'] = 'Delete completion data';
$string['dependencies'] = 'Dependencies';
$string['dependenciescompleted'] = 'Completion of other courses';