Skip to content

Commit

Permalink
MDL-68753 lang: Remove a redundant okay string and use "OK" everywhere
Browse files Browse the repository at this point in the history
The "Ok" (with lower-case "k") string was added in MDL-68409 to keep
backwards compatibility with YUI alerts that had it hard-coded. But we
should not need to explain to translators why we have two OK strings
like this and why they use different wording.

Additionally, there would be inconsistency in Behat tests and everywhere
depending on which "OK" or "Ok" string is used for buttons.

So instead, this patch changes the hard-coded 'Ok' string in the YUI and
we should stick to "OK" from now on everywhere.
  • Loading branch information
mudrd8mz committed May 27, 2020
1 parent c47b174 commit 2615e42
Show file tree
Hide file tree
Showing 32 changed files with 61 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Feature: availability_grade
And I click on "Grade" "link" in the "[email protected]" "table_row"
And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button"
And I press "Ok"
And I press "OK"
And I click on "Edit settings" "link"

# Log back in as student.
Expand Down
2 changes: 1 addition & 1 deletion completion/tests/behat/restrict_activity_by_grade.feature
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Feature: Restrict activity availability through grade conditions
And I set the following fields to these values:
| Grade | 21 |
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I follow "Edit settings"
And I log out
And I log in as "student1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Feature: Restrict sections availability through completion or grade conditions
And I set the following fields to these values:
| Grade | 21 |
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I follow "Edit settings"
And I log out
And I log in as "student1"
Expand Down
2 changes: 1 addition & 1 deletion grade/grading/form/guide/tests/behat/edit_guide.feature
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Feature: Marking guides can be created and edited
And I wait "1" seconds
Then the field "Guide criterion B criterion remark" matches value "Comment \"4\""
When I press "Save changes"
And I press "Ok"
And I press "OK"
And I follow "Edit settings"
And I follow "Test assignment 1 name"
And I navigate to "View all submissions" in current page administration
Expand Down
2 changes: 1 addition & 1 deletion grade/grading/tests/behat/behat_grading.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function i_set_activity_to_use_grading_form($activityname, $templatename)
public function i_save_the_advanced_grading_form() {

$this->execute('behat_forms::press_button', get_string('savechanges'));
$this->execute('behat_forms::press_button', 'Ok');
$this->execute('behat_forms::press_button', 'OK');
$this->execute('behat_general::i_click_on', array($this->escape(get_string('editsettings')), 'link'));
$this->execute('behat_forms::press_button', get_string('cancel'));
$this->execute('behat_navigation::i_navigate_to_in_current_page_administration',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Feature: We can bulk insert grades for students in a course
And I set the following fields to these values:
| Grade out of 100 | 50 |
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I follow "Single view for Test assignment one"
Expand Down Expand Up @@ -79,7 +79,7 @@ Feature: We can bulk insert grades for students in a course
And I set the following fields to these values:
| Grade out of 100 | 50 |
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
# And I click on "input[title='Dock Navigation block']" "css_element"
Expand Down
10 changes: 5 additions & 5 deletions grade/tests/behat/grade_scales.feature
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,23 @@ Feature: View gradebook when scales are used
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade" to "A"
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I click on "[data-action=next-user]" "css_element"
And I set the field "Grade" to "B"
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I click on "[data-action=next-user]" "css_element"
And I set the field "Grade" to "C"
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I click on "[data-action=next-user]" "css_element"
And I set the field "Grade" to "D"
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I click on "[data-action=next-user]" "css_element"
And I set the field "Grade" to "F"
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I am on "Course 1" course homepage
And I navigate to "Setup > Course grade settings" in the course gradebook
And I set the field "Show weightings" to "Show"
Expand Down
2 changes: 1 addition & 1 deletion grade/tests/behat/grade_single_item_scales.feature
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Feature: View gradebook when single item scales are used
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade" to "A"
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I am on "Course 1" course homepage
And I navigate to "Setup > Course grade settings" in the course gradebook
And I set the field "Show weightings" to "Show"
Expand Down
1 change: 0 additions & 1 deletion lang/en/moodle.php
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,6 @@
$string['numyear'] = '{$a} year';
$string['numyears'] = '{$a} years';
$string['ok'] = 'OK';
$string['okay'] = 'Ok';
$string['oldpassword'] = 'Current password';
$string['olduserdirectory'] = 'This is the OLD users directory, and is no longer needed. You may safely delete it. The files it contains have been copied to the NEW user directory.';
$string['optional'] = 'optional';
Expand Down
4 changes: 2 additions & 2 deletions lib/form/tests/behat/modgrade_validation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Feature: Using the activity grade form element
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade" to "C"
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I follow "Edit settings"
When I expand all fieldsets
Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed"
Expand Down Expand Up @@ -203,7 +203,7 @@ Feature: Using the activity grade form element
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "50"
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I follow "Edit settings"
When I expand all fieldsets
Then I should see "Some grades have already been awarded, so the grade type cannot be changed. If you wish to change the maximum grade, you must first choose whether or not to rescale existing grades."
2 changes: 1 addition & 1 deletion lib/templates/local/modal/alert.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@

{{< core/modal }}
{{$footer}}
<button type="button" class="btn btn-primary" data-action="cancel">{{#str}}okay, moodle{{/str}}</button>
<button type="button" class="btn btn-primary" data-action="cancel">{{#str}}ok, moodle{{/str}}</button>
{{/footer}}
{{/ core/modal }}
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,17 @@ Y.extend(ALERT, M.core.notification.info, {
*
* @attribute yesLabel
* @type String
* @default 'Ok'
* @default 'OK'
*/
yesLabel: {
validator: Y.Lang.isString,
setter: function(txt) {
if (!txt) {
txt = 'Ok';
txt = 'OK';
}
return txt;
},
value: 'Ok'
value: 'OK'
}
}
});
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,17 @@ Y.extend(ALERT, M.core.notification.info, {
*
* @attribute yesLabel
* @type String
* @default 'Ok'
* @default 'OK'
*/
yesLabel: {
validator: Y.Lang.isString,
setter: function(txt) {
if (!txt) {
txt = 'Ok';
txt = 'OK';
}
return txt;
},
value: 'Ok'
value: 'OK'
}
}
});
Expand Down
6 changes: 3 additions & 3 deletions lib/yui/src/notification/js/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@ Y.extend(ALERT, M.core.notification.info, {
*
* @attribute yesLabel
* @type String
* @default 'Ok'
* @default 'OK'
*/
yesLabel: {
validator: Y.Lang.isString,
setter: function(txt) {
if (!txt) {
txt = 'Ok';
txt = 'OK';
}
return txt;
},
value: 'Ok'
value: 'OK'
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Feature: In an assignment, teacher can annotate PDF files during grading
And I draw on the pdf
And I press "Save changes"
And I should see "The changes to the grade and feedback were saved"
And I press "Ok"
And I press "OK"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Feature: In a group assignment, teacher can annotate PDF files for all users
Given I set the field "applytoall" to "0"
And I press "Save changes"
And I should see "The changes to the grade and feedback were saved"
And I press "Ok"
And I press "OK"
And I click on "Edit settings" "link"
And I log out
And I log in as "student1"
Expand All @@ -81,7 +81,7 @@ Feature: In a group assignment, teacher can annotate PDF files for all users
@javascript
Scenario: Submit a PDF file as a student and annotate the PDF as a teacher and all students in the group get a copy of the annotated PDF.
Given I press "Save changes"
And I click on "Ok" "button"
And I click on "OK" "button"
And I am on "Course 1" course homepage
And I log out
And I log in as "student1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Feature: In an assignment, teacher can view the feedback for a previous attempt.
And I press "Save changes"
And I wait until the page is ready
And I should see "The changes to the grade and feedback were saved"
And I press "Ok"
And I press "OK"
And I follow "View a different attempt"
And I click on "Attempt 1" "radio" in the "View a different attempt" "dialogue"
And I press "View"
Expand Down
4 changes: 2 additions & 2 deletions mod/assign/feedback/file/tests/behat/feedback_file.feature
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Feature: In an assignment, teacher can submit feedback files during grading
Scenario: A teacher can provide a feedback file when grading an assignment.
Given I set the field "applytoall" to "0"
And I press "Save changes"
And I click on "Ok" "button"
And I click on "OK" "button"
And I click on "Course 1" "link" in the "[data-region=assignment-info]" "css_element"
And I log out
And I log in as "student1"
Expand All @@ -74,7 +74,7 @@ Feature: In an assignment, teacher can submit feedback files during grading
@javascript
Scenario: A teacher can provide a feedback file when grading an assignment and all students in the group will receive the file.
Given I press "Save changes"
And I click on "Ok" "button"
And I click on "OK" "button"
And I click on "Course 1" "link" in the "[data-region=assignment-info]" "css_element"
And I log out
And I log in as "student1"
Expand Down
4 changes: 2 additions & 2 deletions mod/assign/tests/behat/allow_another_attempt.feature
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Feature: In an assignment, students start a new attempt based on their previous
And I set the following fields to these values:
| Allow another attempt | 1 |
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I click on "Edit settings" "link"
And I log out
Then I log in as "student1"
Expand Down Expand Up @@ -150,7 +150,7 @@ Feature: In an assignment, students start a new attempt based on their previous
And I set the following fields to these values:
| Allow another attempt | 1 |
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I follow "Assignment: Test assignment name"
And I log out
And I log in as "student4"
Expand Down
2 changes: 1 addition & 1 deletion mod/assign/tests/behat/comment_inline.feature
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Feature: In an assignment, teachers can edit a students submission inline
| Feedback comments | I'm the teacher feedback |
And I upload "lib/tests/fixtures/empty.txt" file to "Feedback files" filemanager
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
Expand Down
4 changes: 2 additions & 2 deletions mod/assign/tests/behat/display_grade.feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Feature: Check that the assignment grade can be updated correctly
And I set the field "Grade out of 100" to "50"
And I set the field "Notify students" to "0"
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
Expand Down Expand Up @@ -68,7 +68,7 @@ Feature: Check that the assignment grade can be updated correctly
And I set the field "Grade out of 100" to "50"
And I set the field "Notify students" to "0"
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
Expand Down
4 changes: 2 additions & 2 deletions mod/assign/tests/behat/edit_previous_feedback.feature
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Feature: In an assignment, teachers can edit feedback for a students previous su
| Feedback comments | I'm the teacher first feedback |
| Allow another attempt | Yes |
And I press "Save changes"
And I click on "Ok" "button"
And I click on "OK" "button"
And I click on "Edit settings" "link"
And I log out
And I log in as "student2"
Expand All @@ -66,7 +66,7 @@ Feature: In an assignment, teachers can edit feedback for a students previous su
| Grade | 50 |
| Feedback comments | I'm the teacher second feedback |
And I press "Save changes"
And I click on "Ok" "button"
And I click on "OK" "button"
And I click on "Edit settings" "link"
And I log out
Then I log in as "student2"
Expand Down
2 changes: 1 addition & 1 deletion mod/assign/tests/behat/filter_by_marker.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Feature: In an assignment, teachers can filter displayed submissions by assigned
And I set the field "allocatedmarker" to "Marker 1"
And I set the field "Notify students" to "0"
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I click on "Edit settings" "link"
And I log out
When I log in as "teacher1"
Expand Down
10 changes: 5 additions & 5 deletions mod/assign/tests/behat/grading_status.feature
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Feature: View the grading status of an assignment
And I set the field "Feedback comments" to "Great job! Lol, not really."
And I set the field "Notify students" to "0"
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
Expand All @@ -80,7 +80,7 @@ Feature: View the grading status of an assignment
And I should see "1 of 1"
And I set the field "Marking workflow state" to "Released"
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
Expand All @@ -104,7 +104,7 @@ Feature: View the grading status of an assignment
And I set the field "Marking workflow state" to "In marking"
And I set the field "Notify students" to "0"
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
Expand Down Expand Up @@ -154,7 +154,7 @@ Feature: View the grading status of an assignment
And I set the field "Grade out of 100" to "50"
And I set the field "Feedback comments" to "Great job! Lol, not really."
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
Expand Down Expand Up @@ -188,7 +188,7 @@ Feature: View the grading status of an assignment
And I set the field "Grade out of 100" to "99.99"
And I set the field "Feedback comments" to "Even better job! Really."
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
Expand Down
4 changes: 2 additions & 2 deletions mod/assign/tests/behat/group_submission.feature
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ Feature: Group assignment submissions
| Grade out of 100 | 50.0 |
| Apply grades and feedback to entire group | 1 |
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I set the following fields to these values:
| Allow another attempt | 1 |
And I press "Save changes"
And I press "Ok"
And I press "OK"
When I am on "Course 1" course homepage
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
Expand Down
2 changes: 1 addition & 1 deletion mod/assign/tests/behat/hide_grader.feature
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Feature: Hide grader identities identity from students
And I set the field "Grade out of 100" to "50"
And I set the field "Feedback comments" to "Catch for us the foxes."
And I press "Save changes"
And I press "Ok"
And I press "OK"
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
And I should see "Graded" in the "Student 1" "table_row"
Expand Down
Loading

0 comments on commit 2615e42

Please sign in to comment.