Skip to content

Commit

Permalink
MDL-58138 completion: move new lang strings to the completion lang file
Browse files Browse the repository at this point in the history
Part of MDL-58138 epic
  • Loading branch information
snake committed Apr 19, 2017
1 parent 59d9c85 commit 5976f85
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 24 deletions.
14 changes: 7 additions & 7 deletions completion/classes/manager.php
Expand Up @@ -68,7 +68,7 @@ public function get_activities_and_headings() {
$data = new stdClass;
$data->courseid = $this->courseid;
$data->sesskey = sesskey();
$data->helpicon = $OUTPUT->help_icon('temphelp', 'moodle');
$data->helpicon = $OUTPUT->help_icon('bulkcompletiontracking', 'core_completion');
$data->sections = [];
foreach ($sections as $sectionnumber => $section) {
$sectioninfo = $moduleinfo->get_section_info($sectionnumber);
Expand Down Expand Up @@ -134,12 +134,12 @@ private function get_completion_detail($mod) {
break;

case COMPLETION_TRACKING_MANUAL:
$strings['string'] = get_string('manual');
$strings['string'] = get_string('manual', 'completion');
$strings['icon'] = $OUTPUT->pix_icon('i/completion-manual-y', get_string('completion_manual', 'completion'));
break;

case COMPLETION_TRACKING_AUTOMATIC:
$strings['string'] = get_string('withconditions');
$strings['string'] = get_string('withconditions', 'completion');

// Get the descriptions for all the active completion rules for the module.
if ($ruledescriptions = $this->get_completion_active_rule_descriptions($mod)) {
Expand Down Expand Up @@ -171,11 +171,11 @@ protected function get_completion_active_rule_descriptions($moduledata) {

// Generate the description strings for the core conditional completion rules (if set).
if (!empty($moduledata->completionview)) {
$activeruledescriptions[] = get_string('completionview_desc', 'core_completion');
$activeruledescriptions[] = get_string('completionview_desc', 'completion');
}
if ($moduledata instanceof cm_info && !is_null($moduledata->completiongradeitemnumber) ||
($moduledata instanceof stdClass && !empty($moduledata->completionusegrade))) {
$activeruledescriptions[] = get_string('completionusegrade_desc', 'core_completion');
$activeruledescriptions[] = get_string('completionusegrade_desc', 'completion');
}

// Now, ask the module to provide descriptions for its custom conditional completion rules.
Expand All @@ -185,7 +185,7 @@ protected function get_completion_active_rule_descriptions($moduledata) {
}

if (!empty($moduledata->completionexpected)) {
$activeruledescriptions[] = get_string('completionexpecteddesc', 'core_completion',
$activeruledescriptions[] = get_string('completionexpecteddesc', 'completion',
userdate($moduledata->completionexpected));
}

Expand All @@ -206,7 +206,7 @@ public function get_activities_and_resources() {
$data = new stdClass();
$data->courseid = $this->courseid;
$data->sesskey = sesskey();
$data->helpicon = $OUTPUT->help_icon('temphelp', 'moodle');
$data->helpicon = $OUTPUT->help_icon('bulkcompletiontracking', 'core_completion');
// Add icon information.
$data->modules = array_values($modules);
$coursecontext = context_course::instance($this->courseid);
Expand Down
6 changes: 3 additions & 3 deletions course/templates/bulkactivitycompletion.mustache
Expand Up @@ -40,7 +40,7 @@
}}
<div class="container-fluid">
<div class="row m-b-2">
<div class="col">{{#str}}bulkactivitydetail, moodle{{/str}}</div>
<div class="col">{{#str}}bulkactivitydetail, core_completion{{/str}}</div>
</div>
<form method="post" action="editbulkcompletion.php" class="mform" id="theform">
<div class="row m-b-2">
Expand All @@ -51,10 +51,10 @@
<div class="top-section row m-b-1">
<div class="col-sm-6 span6">
<input type="checkbox" class="mastercheck m-r-1" aria-label="{{#str}}checkall, completion{{/str}}">
<label class="font-weight-bold">{{#str}}activitieslabel, moodle{{/str}}</label>
<label class="font-weight-bold">{{#str}}activitieslabel, core_completion{{/str}}</label>
</div>
<div class="col-sm-6">
<label class="font-weight-bold">{{#str}}completiontracking, moodle{{/str}}</label>
<label class="font-weight-bold">{{#str}}completion, core_completion{{/str}}</label>
<span>{{{helpicon}}}</span>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions course/templates/defaultactivitycompletion.mustache
Expand Up @@ -37,7 +37,7 @@
}}
<div class="container-fluid">
<div class="row m-b-2">
<div class="col">{{#str}}bulkactivitydetail, moodle{{/str}}</div>
<div class="col">{{#str}}bulkactivitydetail, core_completion{{/str}}</div>
</div>
<form method="post" action="editdefaultcompletion.php" class="mform" id="theform">
<div class="row m-b-2">
Expand All @@ -48,10 +48,10 @@
<div class="top-section row m-b-1">
<div class="col-sm-6">
<input type="checkbox" class="mastercheck m-r-1" aria-label="{{#str}}checkall, completion{{/str}}">
<label class="font-weight-bold">{{#str}}activitieslabel, moodle{{/str}}</label>
<label class="font-weight-bold">{{#str}}activitieslabel, core_completion{{/str}}</label>
</div>
<div class="col-sm-6">
<label class="font-weight-bold">{{#str}}completiontracking, moodle{{/str}}</label>
<label class="font-weight-bold">{{#str}}completion, core_completion{{/str}}</label>
<span>{{{helpicon}}}</span>
</div>
</div>
Expand Down
10 changes: 10 additions & 0 deletions lang/en/completion.php
Expand Up @@ -26,6 +26,7 @@

$string['achievinggrade'] = 'Achieving grade';
$string['activities'] = 'Activities';
$string['activitieslabel'] = 'Activities / Resources';
$string['activityaggregation'] = 'Condition requires';
$string['activityaggregation_all'] = 'ALL selected activities to be completed';
$string['activityaggregation_any'] = 'ANY selected activities to be completed';
Expand All @@ -39,6 +40,13 @@
$string['approval'] = 'Approval';
$string['badautocompletion'] = 'When you select automatic completion, you must also enable at least one requirement (below).';
$string['bulkactivitycompletion'] = 'Bulk edit activity completion';
$string['bulkactivitydetail'] = 'Select the activities you wish to bulk edit.';
$string['bulkcompletiontracking'] = 'Completion tracking';
$string['bulkcompletiontracking_help'] = '<strong>None:</strong> Do not indicate activity completion
<strong>Manual:</strong> Students can manually mark the activity as completed
<strong>With condition(s):</strong> Show activity as complete when conditions are met';
$string['checkall'] = 'Check or uncheck all activities and resources';
$string['checkallsection'] = 'Check or uncheck all activities and resources in the following section: {$a}';
$string['checkactivity'] = 'Checkbox for activity / resource: {$a}';
Expand Down Expand Up @@ -144,6 +152,7 @@
$string['graderequired'] = 'Required course grade';
$string['gradexrequired'] = '{$a} required';
$string['inprogress'] = 'In progress';
$string['manual'] = 'Manual';
$string['manualcompletionby'] = 'Manual completion by others';
$string['manualcompletionbynote'] = 'Note: The capability moodle/course:markcomplete must be allowed for a role to appear in the list.';
$string['manualselfcompletion'] = 'Manual self completion';
Expand Down Expand Up @@ -192,6 +201,7 @@
$string['usernotenroled'] = 'User is not enrolled in this course';
$string['viewcoursereport'] = 'View course report';
$string['viewingactivity'] = 'Viewing the {$a}';
$string['withconditions'] = 'With conditions';
$string['writingcompletiondata'] = 'Writing completion data';
$string['xdays'] = '{$a} days';
$string['yourprogress'] = 'Your progress';
Expand Down
11 changes: 0 additions & 11 deletions lang/en/moodle.php
Expand Up @@ -30,7 +30,6 @@
$string['activeusers'] = 'Active users';
$string['activities'] = 'Activities';
$string['activities_help'] = 'Activities, such as forums, quizzes and wikis, enable interactive content to be added to the course.';
$string['activitieslabel'] = 'Activities / Resources';
$string['activity'] = 'Activity';
$string['activityclipboard'] = 'Moving this activity: {$a}';
$string['activityiscurrentlyhidden'] = 'Sorry, this activity is currently hidden';
Expand Down Expand Up @@ -218,7 +217,6 @@
$string['brief'] = 'Brief';
$string['bulkactions'] = 'Bulk actions';
$string['bulkactionselect'] = '{$a} bulk action selection';
$string['bulkactivitydetail'] = 'Select the activities you wish to bulk edit.';
$string['bulkmovecoursessuccess'] = 'Successfully moved {$a->courses} courses into {$a->category}';
$string['bycourseorder'] = 'By course order';
$string['byname'] = 'by {$a}';
Expand Down Expand Up @@ -262,7 +260,6 @@
$string['comparelanguage'] = 'Compare and edit current language';
$string['complete'] = 'Complete';
$string['completereport'] = 'Complete report';
$string['completiontracking'] = 'Completion tracking';
$string['configuration'] = 'Configuration';
$string['confirm'] = 'Confirm';
$string['confirmdeletesection'] = 'Are you absolutely sure you want to completely delete "{$a}" and all the activities it contains?';
Expand Down Expand Up @@ -1109,7 +1106,6 @@
$string['managefilters'] = 'Filters';
$string['managemodules'] = 'Modules';
$string['manageroles'] = 'Roles and permissions';
$string['manual'] = 'Manual';
$string['markallread'] = 'Mark all as read';
$string['markedthistopic'] = 'This topic is highlighted as the current topic';
$string['markthistopic'] = 'Highlight this topic as the current topic';
Expand Down Expand Up @@ -1868,12 +1864,6 @@
$string['teacheronly'] = 'for the {$a} only';
$string['teacherroles'] = '{$a} roles';
$string['teachers'] = 'Teachers';
$string['temphelp'] = 'Completion tracking';
$string['temphelp_help'] = '<strong>None:</strong> Do not indicate activity completion
<strong>Manual:</strong> Students can manually mark the activity as completed
<strong>With condition(s):</strong> Show activity as complete when conditions are met';
$string['textediting'] = 'Text editor';
$string['textediting_help'] = 'If an HTML editor such as Atto or TinyMCE is selected, text input areas will have a toolbar with buttons for easily adding content.
Expand Down Expand Up @@ -2037,7 +2027,6 @@
$string['whattodo'] = 'What to do';
$string['windowclosing'] = 'This window should close automatically. If not, please close it now.';
$string['withchosenfiles'] = 'With chosen files';
$string['withconditions'] = 'With conditions';
$string['withdisablednote'] = '{$a} (disabled)';
$string['withoutuserdata'] = 'without user data';
$string['withselectedusers'] = 'With selected users...';
Expand Down

0 comments on commit 5976f85

Please sign in to comment.