Shirayuki has uploaded a new change for review.
https://gerrit.wikimedia.org/r/52966
Change subject: Adding comments for grep
......................................................................
Adding comments for grep
Change-Id: I046c2aca0d7d794c756baa60808bb090a3aa8a65
---
M includes/TimelineGroup.php
M includes/Utils.php
M includes/actions/EditAction.php
M includes/actions/ViewCourseAction.php
M includes/pagers/EPPager.php
M includes/pagers/OrgPager.php
M includes/specials/SpecialEnroll.php
M includes/specials/SpecialManageCourses.php
M resources/ep.enlist.js
M resources/ep.pager.js
10 files changed, 81 insertions(+), 1 deletion(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EducationProgram
refs/changes/66/52966/1
diff --git a/includes/TimelineGroup.php b/includes/TimelineGroup.php
index e9fcae3..c314167 100644
--- a/includes/TimelineGroup.php
+++ b/includes/TimelineGroup.php
@@ -356,6 +356,11 @@
NS_USER_TALK => 'usertalk',
);
+ // Give grep a chance to find the usages:
+ // ep-timeline-users-edit-article, ep-timeline-users-edit-talk,
ep-timeline-users-edit-user,
+ // ep-timeline-users-edit-usertalk,
ep-timeline-users-edit-user-self, ep-timeline-users-edit-usertalk-self,
+ // ep-timeline-users-create-article,
ep-timeline-users-create-talk, ep-timeline-users-create-user,
+ // ep-timeline-users-create-usertalk,
ep-timeline-users-create-user-self, ep-timeline-users-create-usertalk-self
$isNew = array_key_exists( 'parent', $info ) && is_null(
$info['parent'] );
$messageKey = 'ep-timeline-users-' . ( $isNew ? 'create' :
'edit' ) . '-' . $keys[$type];
diff --git a/includes/Utils.php b/includes/Utils.php
index 1cd35df..467b966 100644
--- a/includes/Utils.php
+++ b/includes/Utils.php
@@ -130,6 +130,8 @@
'data-username' => $user->getName(),
'data-bestname' => $role->getName(),
),
+ // Give grep a chance to find the usages:
+ // ep-instructor-remove, ep-campus-remove,
ep-online-remove
$context->msg( 'ep-' . $roleName . '-remove'
)->text()
);
diff --git a/includes/actions/EditAction.php b/includes/actions/EditAction.php
index 7048664..d46308e 100644
--- a/includes/actions/EditAction.php
+++ b/includes/actions/EditAction.php
@@ -109,6 +109,8 @@
$object = $this->table->newRow( $data, true );
}
elseif ( $this->isNewPost() ) {
+ // Give grep a chance to find the usages:
+ // ep-editorg-exists-already,
ep-editcourse-exists-already
$this->showWarning( $this->msg( 'ep-' .
strtolower( $this->getName() ) . '-exists-already' ) );
}
diff --git a/includes/actions/ViewCourseAction.php
b/includes/actions/ViewCourseAction.php
index 45254b6..2d6137f 100644
--- a/includes/actions/ViewCourseAction.php
+++ b/includes/actions/ViewCourseAction.php
@@ -199,6 +199,8 @@
$users = $course->getUserWithRole( $roleName );
if ( empty( $users ) ) {
+ // Give grep a chance to find the usages:
+ // ep-course-no-instructor, ep-course-no-online,
ep-course-no-campus
$html = $this->msg( 'ep-course-no-' . $roleName
)->escaped();
}
else {
@@ -243,6 +245,8 @@
if ( ( $user->isAllowed( 'ep-' . $roleName ) ||
$user->isAllowed( 'ep-be' . $roleName ) )
&& !in_array( $user->getId(), $course->getField( $field
) )
) {
+ // Give grep a chance to find the usages:
+ // ep-course-become-instructor,
ep-course-become-online, ep-course-become-campus
$links[] = Html::element(
'a',
array(
@@ -258,6 +262,8 @@
}
if ( $user->isAllowed( 'ep-' . $roleName ) ) {
+ // Give grep a chance to find the usages:
+ // ep-course-add-instructor, ep-course-add-online,
ep-course-add-campus
$links[] = Html::element(
'a',
array(
diff --git a/includes/pagers/EPPager.php b/includes/pagers/EPPager.php
index f84329b..4481a19 100644
--- a/includes/pagers/EPPager.php
+++ b/includes/pagers/EPPager.php
@@ -380,6 +380,9 @@
break;
}
+ // Give grep a chance to find the usages:
+ // eporgpager-filter-country, eporgpager-filter-active,
epcoursepager-filter-term,
+ // epcoursepager-filter-lang,
epcoursepager-filter-org-id, epcoursepager-filter-status
$control = ' ' . $this->getMsg( 'filter-' .
$optionName ) . ' ' . $control;
$controls[] = $control;
diff --git a/includes/pagers/OrgPager.php b/includes/pagers/OrgPager.php
index 1c64816..aabff83 100644
--- a/includes/pagers/OrgPager.php
+++ b/includes/pagers/OrgPager.php
@@ -120,6 +120,7 @@
case 'active':
// @todo FIXME: Add full text of all used
message keys here for grepping
// and transparancy purposes.
+ // Give grep a chance to find the usages:
eporgpager-yes, eporgpager-no
$value = $this->msg( 'eporgpager-' . ( $value
== '1' ? 'yes' : 'no' ) )->escaped();
break;
}
diff --git a/includes/specials/SpecialEnroll.php
b/includes/specials/SpecialEnroll.php
index b8d962b..a9e2d44 100644
--- a/includes/specials/SpecialEnroll.php
+++ b/includes/specials/SpecialEnroll.php
@@ -98,6 +98,8 @@
else {
$this->setPageTitle( $course );
+ // Give grep a chance to find the usages:
+ // ep-enroll-course-passed,
ep-enroll-course-planned
$this->showWarning( $this->msg(
'ep-enroll-course-' . $course->getStatus() ) );
}
}
diff --git a/includes/specials/SpecialManageCourses.php
b/includes/specials/SpecialManageCourses.php
index bda5326..1bd8410 100644
--- a/includes/specials/SpecialManageCourses.php
+++ b/includes/specials/SpecialManageCourses.php
@@ -144,8 +144,11 @@
$classNameForMessage = str_replace( 'educationprogram\\', 'ep',
strtolower( $class ) );
if ( !empty( $courses ) ) {
- // @todo FIXME: Add full text of all used
message keys here for grepping
+ // @todo FIXME: Add full text of all used message keys
here for grepping
// and transparancy purposes.
+ // Give grep a chance to find the usages:
+ // ep-mycourses-courses-epoa, ep-mycourses-courses-epca,
+ // ep-mycourses-courses-epinstructor,
ep-mycourses-courses-epstudent
$message = $this->msg( 'ep-mycourses-courses-' .
$classNameForMessage )
->numParams( count( $courses ) )->params(
$this->getUser()->getName() )->text();
$this->getOutput()->addElement( 'h2', array(), $message
);
@@ -161,6 +164,9 @@
}
}
elseif ( $isAllowed ) {
+ // Give grep a chance to find the usages:
+ // ep-mycourses-nocourses-epstudent,
ep-mycourses-nocourses-epca,
+ // ep-mycourses-nocourses-epoa,
ep-mycourses-nocourses-epinstructor
$this->getOutput()->addWikiMsg(
'ep-mycourses-nocourses-' . $classNameForMessage, $this->getUser()->getName() );
}
}
diff --git a/resources/ep.enlist.js b/resources/ep.enlist.js
index 7e45315..3f15212 100644
--- a/resources/ep.enlist.js
+++ b/resources/ep.enlist.js
@@ -28,6 +28,8 @@
var $remove = $( '#ep-' + role +
'-remove-button' ),
$cancel = $( '#ep-' + role +
'-cancel-button' );
+ // Give grep a chance to find the usages:
+ // ep-instructor-removing, ep-online-removing,
ep-campus-removing
$remove.button( 'option', 'disabled', true );
$remove.button( 'option', 'label', ep.msg(
'ep-' + role + '-removing' ) );
@@ -37,6 +39,9 @@
'reason': summaryInput.val(),
'role': role
} ).done( function() {
+ // Give grep a chance to find the
usages:
+ // ep-instructor-removal-success,
ep-online-removal-success, ep-campus-removal-success,
+ // ep-instructor-close-button,
ep-online-close-button, ep-campus-close-button
$dialog.text( ep.msg( 'ep-' + role +
'-removal-success' ) );
$remove.remove();
$cancel.button( 'option', 'label',
ep.msg( 'ep-' + role + '-close-button' ) );
@@ -46,16 +51,23 @@
$ul = $li.closest( 'ul' );
$li.remove();
+ // Give grep a chance to find the
usages:
+ // ep-course-no-instructor,
ep-course-no-online, ep-course-no-campus
if ( $ul.find( 'li' ).length < 1 ) {
$ul.closest( 'div' ).text(
mw.msg( 'ep-course-no-' + role ) );
}
} ).fail( function() {
+ // Give grep a chance to find the
usages:
+ // ep-instructor-remove-retry,
ep-online-remove-retry, ep-campus-remove-retry,
+ // ep-instructor-remove-failed,
ep-online-remove-failed, ep-campus-remove-failed
$remove.button( 'option', 'disabled',
false );
$remove.button( 'option', 'label',
ep.msg( 'ep-' + role + '-remove-retry' ) );
alert( ep.msg( 'ep-' + role +
'-remove-failed' ) );
} );
};
+ // Give grep a chance to find the usages:
+ // ep-instructor-summary, ep-online-summary,
ep-campus-summary
summaryLabel = $( '<label>' ).attr( {
'for': 'epenlistsummary'
} ).msg( 'ep-' + role + '-summary' ).append( ' ' );
@@ -67,6 +79,10 @@
'id': 'epenlistsummary'
} );
+ // Give grep a chance to find the usages:
+ // ep-instructor-remove-title, ep-online-remove-title,
ep-campus-remove-title,
+ // ep-instructor-remove-button,
ep-online-remove-button, ep-campus-remove-button,
+ // ep-instructor-cancel-button,
ep-online-cancel-button, ep-campus-cancel-button
$dialog = $( '<div>' ).html( '' ).dialog( {
'title': ep.msg( 'ep-' + role + '-remove-title'
),
'minWidth': 550,
@@ -86,6 +102,8 @@
]
} );
+ // Give grep a chance to find the usages:
+ // ep-instructor-remove-text, ep-online-remove-text,
ep-campus-remove-text
$dialog.append( $( '<p>' ).msg(
'ep-' + role + '-remove-text',
mw.html.escape( userName ),
@@ -145,6 +163,8 @@
$cancel = $( '#ep-' + role +
'-add-cancel-button' ),
enterHandler;
+ // Give grep a chance to find the usages:
+ // ep-instructor-adding, ep-online-adding,
ep-campus-adding
$add.button( 'option', 'disabled', true );
$add.button( 'option', 'label', ep.msg( 'ep-' +
role + '-adding' ) );
@@ -156,6 +176,10 @@
} ).done( function( data ) {
var messageKey = null, $ul;
+ // Give grep a chance to find the
usages:
+ // ep-instructor-addittion-null,
ep-online-addittion-null, ep-campus-addittion-null,
+ //
ep-instructor-addittion-self-success, ep-online-addittion-self-success,
ep-campus-addittion-self-success,
+ // ep-instructor-addittion-success,
ep-online-addittion-success, ep-campus-addittion-success
if ( data.count === 0 ) {
messageKey = 'ep-' + role +
'-addittion-null';
}
@@ -169,6 +193,8 @@
_this.courseName
) );
+ // Give grep a chance to find the
usages:
+ // ep-instructor-add-close-button,
ep-online-add-close-button, ep-campus-add-close-button
$add.remove();
$cancel.button( 'option', 'label',
ep.msg( 'ep-' + role + '-add-close-button' ) );
$cancel.focus();
@@ -185,9 +211,13 @@
$ul.append( $( '<li>' ).text(
_this.getName() ) );
}
} ).fail( function( data ) {
+ // Give grep a chance to find the
usages:
+ // ep-instructor-add-retry,
ep-online-add-retry, ep-campus-add-retry
$add.button( 'option', 'disabled',
false );
$add.button( 'option', 'label', ep.msg(
'ep-' + role + '-add-retry' ) );
+ // Give grep a chance to find the
usages:
+ // ep-instructor-addittion-failed,
ep-online-addittion-failed, ep-campus-addittion-failed
var msgKey = data.error ? 'ep-' + role
+ '-addittion-' + data.error.code : 'ep-' + role + '-addittion-failed';
alert( ep.msg(
@@ -198,6 +228,12 @@
} );
};
+ // Give grep a chance to find the usages:
+ // ep-instructor-add-self-title,
ep-online-add-self-title, ep-campus-add-self-title,
+ // ep-instructor-add-title, ep-online-add-title,
ep-campus-add-title,
+ // ep-instructor-add-self-button,
ep-online-add-self-button, ep-campus-add-self-button,
+ // ep-instructor-add-button, ep-online-add-button,
ep-campus-add-button,
+ // ep-instructor-add-cancel-button,
ep-online-add-cancel-button, ep-campus-add-cancel-button
this.$dialog = $( '<div>' ).html( '' ).dialog( {
'title': ep.msg( this.selfMode ? 'ep-' + role +
'-add-self-title' : 'ep-' + role + '-add-title', this.getName() ),
'minWidth': 550,
@@ -220,12 +256,18 @@
]
} );
+ // Give grep a chance to find the usages:
+ // ep-instructor-add-self-text,
ep-online-add-self-text, ep-campus-add-self-text,
+ // ep-instructor-add-text, ep-online-add-text,
ep-campus-add-text
this.$dialog.append( $( '<p>' ).text( gM(
this.selfMode ? 'ep-' + role + '-add-self-text'
: 'ep-' + role + '-add-text',
this.courseName,
this.getName()
) ) );
+ // Give grep a chance to find the usages:
+ // ep-instructor-name-input, ep-online-name-input,
ep-campus-name-input,
+ // ep-instructor-summary-input,
ep-online-summary-input, ep-campus-summary-input
if ( !this.selfMode ) {
this.$dialog.append(
$( '<label>' ).attr( {
diff --git a/resources/ep.pager.js b/resources/ep.pager.js
index c529390..34275aa 100644
--- a/resources/ep.pager.js
+++ b/resources/ep.pager.js
@@ -39,6 +39,8 @@
'minWidth': 550,
'buttons': [
{
+ // Give grep a chance to find
the usages:
+ // ep-pager-delete-button-org,
ep-pager-delete-button-course
'text': ep.msg(
'ep-pager-delete-button-' + args.type, args.ids.length ),
'id': 'ep-pager-remove-button',
'click': function() {
@@ -48,6 +50,8 @@
}
},
{
+ // Give grep a chance to find
the usages:
+ // ep-pager-cancel-button-org,
ep-pager-cancel-button-course
'text': ep.msg(
'ep-pager-cancel-button-' + args.type ),
'id': 'ep-pager-cancel-button',
'click': function() {
@@ -64,12 +68,17 @@
return '<strong>' + mw.html.escape( name ) +
'</strong>';
} ).join( ', ' );
+ // Give grep a chance to find the usages:
+ // ep-pager-confirm-message-org,
ep-pager-confirm-message-course,
+ // ep-pager-confirm-message-org-many,
ep-pager-confirm-message-course-many
$dialog.msg(
'ep-pager-confirm-message-' + args.type + (
args.names.length > 1 ? '-many' : '' ),
$( '<span>' ).html( names ),
args.names.length
);
+ // Give grep a chance to find the usages:
+ // ep-pager-confirm-message-org,
ep-pager-confirm-message-course
summaryLabel = $( '<label>' ).attr( {
'for': 'epsummaryinput'
} ).msg( 'ep-pager-summary-message-' + args.type
).append( ' ' );
@@ -96,6 +105,8 @@
};
onFail = function( type ) {
+ // Give grep a chance to find the usages:
+ // ep-pager-retry-button-org,
ep-pager-retry-button-course
$remove.button( 'option', 'disabled', false );
$remove.button( 'option', 'label', ep.msg(
'ep-pager-retry-button-' + type ) );
};
--
To view, visit https://gerrit.wikimedia.org/r/52966
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I046c2aca0d7d794c756baa60808bb090a3aa8a65
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EducationProgram
Gerrit-Branch: master
Gerrit-Owner: Shirayuki <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits