Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-38317 grade import: Translation support for import mappings form.

  • Loading branch information...
commit 3aaa906b1e2eb0a8c4272f0ba2319a3dda459cb4 1 parent 83f26f6
Jean-Philippe Gaudreau gaudreaj authored
3  grade/import/csv/index.php
View
@@ -63,7 +63,8 @@
$displaystring = null;
if (!empty($grade_item->itemmodule)) {
- $displaystring = get_string('modulename', $grade_item->itemmodule).': '.$grade_item->get_name();
+ $displaystring = get_string('modulename', $grade_item->itemmodule).get_string('labelsep', 'langconfig')
+ .$grade_item->get_name();
} else {
$displaystring = $grade_item->get_name();
}
30 grade/import/grade_import_form.php
View
@@ -88,17 +88,22 @@ function definition () {
}
$mform->addElement('select', 'mapfrom', get_string('mapfrom', 'grades'), $mapfromoptions);
- $maptooptions = array('userid'=>'userid', 'username'=>'username', 'useridnumber'=>'useridnumber', 'useremail'=>'useremail', '0'=>'ignore');
+ $maptooptions = array(
+ 'userid' => get_string('userid', 'grades'),
+ 'username' => get_string('username'),
+ 'useridnumber' => get_string('idnumber'),
+ 'useremail' => get_string('email'),
+ '0' => get_string('ignore', 'grades')
+ );
$mform->addElement('select', 'mapto', get_string('mapto', 'grades'), $maptooptions);
$mform->addElement('header', 'general', get_string('mappings', 'grades'));
- // add a comment option
-
- $comments = array();
+ // Add a feedback option.
+ $feedbacks = array();
if ($gradeitems = $this->_customdata['gradeitems']) {
foreach ($gradeitems as $itemid => $itemname) {
- $comments['feedback_'.$itemid] = 'comments for '.$itemname;
+ $feedbacks['feedback_'.$itemid] = get_string('feedbackforgradeitems', 'grades', $itemname);
}
}
@@ -106,11 +111,16 @@ function definition () {
$i = 0; // index
foreach ($header as $h) {
$h = trim($h);
- // this is what each header maps to
- $mform->addElement('selectgroups', 'mapping_'.$i, s($h),
- array('others'=>array('0'=>'ignore', 'new'=>'new gradeitem'),
- 'gradeitems'=>$gradeitems,
- 'comments'=>$comments));
+ // This is what each header maps to.
+ $headermapsto = array(
+ get_string('others', 'grades') => array(
+ '0' => get_string('ignore', 'grades'),
+ 'new' => get_string('newitem', 'grades')
+ ),
+ get_string('gradeitems', 'grades') => $gradeitems,
+ get_string('feedbacks', 'grades') => $feedbacks
+ );
+ $mform->addElement('selectgroups', 'mapping_'.$i, s($h), $headermapsto);
$i++;
}
}
5 lang/en/grades.php
View
@@ -202,6 +202,8 @@
$string['feedback_help'] = 'This box enables any comments about the grade to be added.';
$string['feedbackadd'] = 'Add feedback';
$string['feedbackedit'] = 'Edit feedback';
+$string['feedbackforgradeitems'] = 'Feedback for {$a}';
+$string['feedbacks'] = 'Feedbacks';
$string['feedbacksaved'] = 'Feedback saved';
$string['feedbackview'] = 'View feedback';
$string['finalgrade'] = 'Final grade';
@@ -335,6 +337,7 @@
$string['choosecategory'] = 'Select category';
$string['identifier'] = 'Identify user by';
$string['idnumbers'] = 'ID numbers';
+$string['ignore'] = 'Ignore';
$string['import'] = 'Import';
$string['importcsv'] = 'Import CSV';
$string['importcustom'] = 'Import as custom outcomes (only this course)';
@@ -446,6 +449,7 @@
$string['onascaleof'] = 'on a scale of {$a->grademin} to {$a->grademax}';
$string['operations'] = 'Operations';
$string['options'] = 'Options';
+$string['others'] = 'Others';
$string['outcome'] = 'Outcome';
$string['outcome_help'] = 'This setting determines the outcome which this grade item will represent in the gradebook.';
$string['outcomeassigntocourse'] = 'Assign another outcome to this course';
@@ -656,6 +660,7 @@
$string['usepercent'] = 'Use percent';
$string['user'] = 'User';
$string['usergrade'] = 'User {$a->fullname} ({$a->useridnumber}) on item {$a->gradeidnumber}';
+$string['userid'] = 'User ID';
$string['userpreferences'] = 'User preferences';
$string['userenrolmentsuspended'] = 'User enrolment suspended';
$string['useweighted'] = 'Use weighted';
Please sign in to comment.
Something went wrong with that request. Please try again.