jenkins-bot has submitted this change and it was merged.
Change subject: Add Newsletter extension to translatewiki.net
......................................................................
Add Newsletter extension to translatewiki.net
Added prefix, 'newsletter-' to all the i18n keys and
also added Newsletter.alias.php file and new i18n keys.
Bug: T102945
Change-Id: I504a29b2de43c19356a3b452f537188da4dda186
---
A Newsletter.alias.php
M Newsletter.hooks.php
M i18n/en.json
M i18n/qqq.json
M includes/SpecialNewsletterCreate.php
M includes/SpecialNewsletterManage.php
M includes/SpecialNewsletters.php
7 files changed, 112 insertions(+), 66 deletions(-)
Approvals:
Raimond Spekking: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Newsletter.alias.php b/Newsletter.alias.php
new file mode 100644
index 0000000..b594417
--- /dev/null
+++ b/Newsletter.alias.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Aliases for Newsletter
+ *
+ * @file
+ * @ingroup Extensions
+ */
+
+$specialPageAliases = array();
+
+/** English */
+$specialPageAliases['en'] = array(
+ 'NewsletterCreate' => array( 'CreateNewsletter'),
+ 'NewsletterManage' => array( 'ManageNewsletter'),
+ 'Newsletters' => array( 'Newsletters'),
+);
\ No newline at end of file
diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php
index 390b6c4..3e97278 100755
--- a/Newsletter.hooks.php
+++ b/Newsletter.hooks.php
@@ -17,13 +17,13 @@
);
$notifications['subscribe-newsletter'] = array(
'primary-link' => array(
- 'message' => 'notification-link-text-new-issue',
+ 'message' =>
'newsletter-notification-link-text-new-issue',
'destination' => 'new-issue'
),
'formatter-class' => 'EchoNewsletterFormatter',
- 'title-message' => 'notification-newsletter-title',
+ 'title-message' => 'newsletter-notification-title',
'title-params' => array( 'newsletter', 'title' ),
- 'flyout-message' => 'notification-newsletter-flyout',
+ 'flyout-message' => 'newsletter-notification-flyout',
'flyout-params' => array( 'newsletter', 'title' ),
);
diff --git a/i18n/en.json b/i18n/en.json
index dda5810..8565ddf 100755
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -7,34 +7,49 @@
"newsletter-desc": "Adds a preference for users to subscribe to a
newsletter",
"newslettercreate": "Create newsletters",
"newslettermanage": "Manage newsletters",
- "announceissueform-announceissue-section": "Announce new issue",
- "announceissueform-addpublisher-section": "Add Publishers",
- "createnewsletter-section": "Create newsletter",
+ "newsletter-name": "Name of newsletter",
+ "newsletter-desc": "Description",
+ "newsletter-title": "Title of Main Page",
+ "newsletter-frequency": "Frequency",
+ "newsletter-option-weekly": "weekly",
+ "newsletter-option-monthly": "monthly",
+ "newsletter-option-quarterly": "quarterly",
+ "newsletter-issue-title": "Title of issue's main page",
+ "newsletter-publisher-username": "Username",
+ "newsletter-issuepage-not-found-error": "The newsletter issue page
cannot be found. Please try again",
+ "newsletter-invalid-username-error": "Invalid username",
+ "newsletter-unconfirmed-email-error": "The provided username does not
have a confirmed email address!",
+ "newsletter-required-fields-error": "Required fields are empty",
+ "newsletter-exist-error": "A newsletter with the same name already
exists. Try again with another name",
+ "newsletter-mainpage-not-found-error": "The Newsletter main page cannot
be found. Please try again",
+ "newsletter-announceissueform-announceissue-section": "Announce new
issue",
+ "newsletter-announceissueform-addpublisher-section": "Add publishers",
+ "newsletter-create-section": "Create newsletter",
"newsletter-create-confirmation": "Good job! You just created a new
newsletter.",
- "issue-announce-confirmation": "Good job! You just announced a new
issue of your newsletter.",
+ "newsletter-issue-announce-confirmation": "Good job! You just announced
a new issue of your newsletter.",
"newsletters": "Newsletters",
"newsletter-subscribe-section": "Subscribe newsletters",
"newsletter-unsubscribe-section": "Unsubscribe newsletters",
"newsletter-subscribe-confirmation": "You are now subscribed to the
newsletter.",
"newsletter-unsubscribe-confirmation": "You are now unsubscribed from
the newsletter.",
- "subscribe-button-label": "Yes",
- "unsubscribe-button-label": "No",
- "available-newsletters-field-label": "Available newsletters",
- "subscribed-newsletters-field-label": "Subscribed newsletters",
+ "newsletter-subscribe-button-label": "Yes",
+ "newsletter-unsubscribe-button-label": "No",
+ "newsletter-available-newsletters-field-label": "Available newsletters",
+ "newsletter-subscribed-newsletters-field-label": "Subscribed
newsletters",
"echo-category-title-newsletter": "Newsletters",
"echo-pref-tooltip-newsletter": "Notify me when any of the newsletters
to which I have subscribed to announces a new issue.",
- "notification-newsletter-title": "$1 has announced an issue. In this
issue: [[:$2]]",
- "notification-newsletter-flyout": "$1 has announced a new issue. \n\nIn
this issue: [[:$2]]",
- "notification-link-text-new-issue": "View new issue",
- "newsletter-header-name": "Name of Newsletter",
+ "newsletter-notification-title": "$1 has announced an issue",
+ "newsletter-notification-flyout": "$1 has announced a new issue",
+ "newsletter-notification-link-text-new-issue": "View new issue",
+ "newsletter-header-name": "Name of newsletter",
"newsletter-header-description": "Description",
- "newsletter-header-action": "Subscribed ?",
+ "newsletter-header-action": "Subscribed?",
"newsletter-header-subscriber_count": "Subscriber count",
- "new-publisher-confirmation": "A new publisher has just been added to
your newsletter !",
- "newslettermanage-header-name": "Newsletter",
- "newslettermanage-header-publisher": "Contributors",
- "newslettermanage-header-permissions": "Permissions",
- "newslettermanage-header-action": "Action",
- "owner-radiobutton-label": "Owner",
- "publisher-radiobutton-label": "Publisher"
+ "newsletter-new-publisher-confirmation": "A new publisher has just been
added to your newsletter!",
+ "newsletter-manage-header-name": "Newsletter",
+ "newsletter-manage-header-publisher": "Contributors",
+ "newsletter-manage-header-permissions": "Permissions",
+ "newsletter-manage-header-action": "Action",
+ "newsletter-owner-radiobutton-label": "Owner",
+ "newsletter-publisher-radiobutton-label": "Publisher"
}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b93a594..d831b2e 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -7,33 +7,48 @@
"newsletter-desc":
"{{desc|name=Newsletter|url=https://www.mediawiki.org/wiki/Extension:Newsletter}}",
"newslettercreate": "Name of special page which creates newsletters as
seen in URLs and links",
"newslettermanage": "Name of special page which announces issues as
seen in URLs and links",
- "announceissueform-announceissue-section": "Header of section in
[[Special:NewsletterManage]] which announces issues",
- "announceissueform-addpublisher-section": "Header of section in
[[Special:NewsletterManage]] which adds publishers",
- "createnewsletter-section": "Section header of
[[Special:NewsletterCreate]]",
+ "newsletter-name": "Label of the field which takes the name of
newsletter as input in [[Special:NewsletterManage]] and
[[Special:NewsletterCreate]]",
+ "newsletter-desc": "Label of the field which takes a short description
of newsletter as input in [[Special:NewsletterCreate]]",
+ "newsletter-title": "Label of the field which takes the title of Main
Page of newsletter as input in [[Special:NewsletterCreate]]",
+ "newsletter-frequency": "Label of the field which takes the frequency
of newsletter as input in [[Special:NewsletterCreate]]",
+ "newsletter-option-weekly": "Option message of the 'weekly' option of
the frequency field in [[Special:NewsletterCreate]]",
+ "newsletter-option-monthly": "Option message of the 'monthly' option in
the drop down menu for frequency field in [[Special:NewsletterCreate]]",
+ "newsletter-option-quarterly": "Option message of the 'quarterly'
option in the drop down menu for frequency field in
[[Special:NewsletterCreate]]",
+ "newsletter-issue-title": "Label of the field which takes the title of
the issue as input in [[Special:NewsletterManage]]",
+ "newsletter-publisher-username": "Label of the field which takes the
username of the publisher to be added as input in [[Special:NewsletterManage]]",
+ "newsletter-issuepage-not-found-error": "Error message to be displayed
when newsletter issue page cannot be found while adding new issue in
[[Special:NewsletterManage]]",
+ "newsletter-invalid-username-error": "Error message to be displayed
when invalid username given as input in [[Special:NewsletterManage]]",
+ "newsletter-unconfirmed-email-error": "Error message to be displayed in
[[Special:NewsletterManage]] when the username of the publisher to be added
does not have a confirmed email address",
+ "newsletter-required-fields-error": "Error message to be displayed when
required fields are empty in [[Special:NewsletterManage]]",
+ "newsletter-exist-error": "Error message to be displayed in
[[Special:NewsletterCreate]] when trying to create a newsletter with same name
as an existing newsletter",
+ "newsletter-mainpage-not-found-error": "Error message to be displayed
in [[Special:NewsletterCreate]] when trying to create a newsletter with invalid
main page",
+ "newsletter-announceissueform-announceissue-section": "Header of
section in [[Special:NewsletterManage]] which announces issues",
+ "newsletter-announceissueform-addpublisher-section": "Header of section
in [[Special:NewsletterManage]] which adds publishers",
+ "newsletter-create-section": "Section header of
[[Special:NewsletterCreate]]",
"newsletter-create-confirmation": "Confirmation message displayed after
creation of a newsletter",
- "issue-announce-confirmation": "Confirmation message displayed after
announcing a new issue",
+ "newsletter-issue-announce-confirmation": "Confirmation message
displayed after announcing a new issue",
"newsletters": "Name of special page for user to subscribe to or
unsubscribe from newsletters",
"newsletter-subscribe-section": "Section header of HTML form in
[[Special:Newsletters]] which allows users to subscribe.",
"newsletter-unsubscribe-section": "Section header of HTML form in
[[Special:Newsletters]] which allows users to un-subscribe.",
"newsletter-subscribe-confirmation": "Confirmation message displayed
after subscribing to a newsletter",
"newsletter-unsubscribe-confirmation": "Confirmation message displayed
after un-subscribing from a newsletter",
- "subscribe-button-label": "Label of submit button of HTML form which
allows users to subscribe.",
- "unsubscribe-button-label": "Label of submit button of HTML form which
allows users to un-subscribe.",
- "available-newsletters-field-label": "Label of HTML form field which
lists all available newsletters in wiki",
- "subscribed-newsletters-field-label": "Label of HTML form field which
lists all newsletters to which user is subscribed to.",
+ "newsletter-subscribe-button-label": "Label of submit button of HTML
form which allows users to subscribe.",
+ "newsletter-unsubscribe-button-label": "Label of submit button of HTML
form which allows users to un-subscribe.",
+ "newsletter-available-newsletters-field-label": "Label of HTML form
field which lists all available newsletters in wiki",
+ "newsletter-subscribed-newsletters-field-label": "Label of HTML form
field which lists all newsletters to which user is subscribed to.",
"echo-category-title-newsletter": "Title of the notification category
used by Newsletter extension.\n{{Related|Echo-category-title}}",
"echo-pref-tooltip-newsletter": "Short description of the newsletter
notification category.\n{{Related|Echo-pref-tooltip}}",
- "notification-newsletter-title": "Title message of Echo notification to
notify a user of a new issue from a newsletter he/she has subscribed to.
Parameters:\n* $1 is is the name of the newsletter \n* $2 is a link to the main
page of the issue.",
- "notification-newsletter-flyout": "Flyout message of Echo notification
to notify the user of a new issue from a newsletter he/she has subscribed to.
Parameters:\n* $1 is the name of the newsletter \n* $2 is a link to the main
page of the issue.",
- "notification-link-text-new-issue": "Label of the primary link of the
notification-newsletter-flyout, which on clicking navigates the user to the
newly announced issue of a newsletter.",
+ "newsletter-notification-newsletter-title": "Title message of Echo
notification to notify a user of a new issue from a newsletter he/she has
subscribed to. Parameters:\n* $1 is is the name of the newsletter.",
+ "newsletter-notification-newsletter-flyout": "Flyout message of Echo
notification to notify the user of a new issue from a newsletter he/she has
subscribed to. Parameters:\n* $1 is the name of the newsletter.",
+ "newsletter-notification-link-text-new-issue": "Label of the primary
link of the notification-newsletter-flyout, which on clicking navigates the
user to the newly announced issue of a newsletter.",
"newsletter-header-name": "Label of the first column of table in
[[Special:Newsletters]] which lists the names of newsletters",
"newsletter-header-description": "Label of the second column of table
in [[Special:Newsletters]] which displays a description about the newsletter",
"newsletter-header-subscriber_count": "Label of the third column of
table in [[Special:Newsletters]] which gives the subscriber count of
corresponding newsletter",
"newsletter-header-action": "Label of the fourth column of table in
[[Special:Newsletters]] which provides radio buttons to subscribe/unsubscribe
newsletters",
- "new-publisher-confirmation": "Confirmation message displayed after a
new publisher is added for a newsletter through the
[[Special:NewsletterManage]] page",
- "newslettermanage-header-name": "Label of the first column of table in
[[Special:NewsletterManage]] which lists the names of newsletters",
- "newslettermanage-header-publisher": "Label of the second column of
table in [[Special:NewsletterManage]] which lists the names of all publishers
of a newsletter",
- "newslettermanage-header-permissions": "Label of the third column of
table in [[Special:NewsletterManage]] which lists the roles of a user",
- "owner-radiobutton-label": "Label of radio button in 'Permissions'
column in [[Special:NewsletterManage]] which is checked if the user is the
owner of the newsletter",
- "publisher-radiobutton-label": "Label of radio button in 'Permissions'
column in [[Special:NewsletterManage]] which is checked if the user is a
publisher of the newsletter"
+ "newsletter-new-publisher-confirmation": "Confirmation message
displayed after a new publisher is added for a newsletter through the
[[Special:NewsletterManage]] page",
+ "newsletter-manage-header-name": "Label of the first column of table in
[[Special:NewsletterManage]] which lists the names of newsletters",
+ "newsletter-manage-header-publisher": "Label of the second column of
table in [[Special:NewsletterManage]] which lists the names of all publishers
of a newsletter",
+ "newsletter-manage-header-permissions": "Label of the third column of
table in [[Special:NewsletterManage]] which lists the roles of a user",
+ "newsletter-owner-radiobutton-label": "Label of radio button in
'Permissions' column in [[Special:NewsletterManage]] which is checked if the
user is the owner of the newsletter",
+ "newsletter-publisher-radiobutton-label": "Label of radio button in
'Permissions' column in [[Special:NewsletterManage]] which is checked if the
user is a publisher of the newsletter"
}
\ No newline at end of file
diff --git a/includes/SpecialNewsletterCreate.php
b/includes/SpecialNewsletterCreate.php
index 9ba56ec..4f786b7 100644
--- a/includes/SpecialNewsletterCreate.php
+++ b/includes/SpecialNewsletterCreate.php
@@ -18,7 +18,7 @@
$createNewsletterForm = new HTMLForm( $createNewsletterArray,
$this->getContext(), 'createnewsletterform' );
$createNewsletterForm->setSubmitText( 'Create newsletter' );
$createNewsletterForm->setSubmitCallback( array(
'SpecialNewsletterCreate', 'onSubmitNewsletter' ) );
- $createNewsletterForm->setWrapperLegendMsg(
'createnewsletter-section' );
+ $createNewsletterForm->setWrapperLegendMsg(
'newsletter-create-section' );
# Show HTML forms
$createNewsletterForm->show();
$output->returnToMain();
@@ -34,28 +34,28 @@
'name' => array(
'type' => 'text',
'required' => true,
- 'label' => 'Name of newsletter'
+ 'label' => $this->msg( 'newsletter-name' )
),
'description' => array(
'type' => 'textarea',
'required' => true,
- 'label' => 'Description',
+ 'label' => $this->msg( 'newsletter-desc' ),
'rows' => 15,
'cols' => 50,
),
'mainpage' => array(
'required' => true,
'type' => 'text',
- 'label' => 'Title of Main Page'
+ 'label' => $this->msg( 'newsletter-title' )
),
'frequency' => array(
'required' => true,
'type' => 'selectorother',
- 'label' => 'Frequency',
+ 'label' => $this->msg( 'newsletter-frequency' ),
'options' => array(
- 'weekly' => 'weekly',
- 'monthly' => 'monthly',
- 'quarterly' => 'quarterly'
+ 'weekly' => $this->msg(
'newsletter-option-weekly' ),
+ 'monthly' => $this->msg(
'newsletter-option-monthly' ),
+ 'quarterly' => $this->msg(
'newsletter-option-quarterly' )
),
'size' => 18, # size of 'other' field
'maxlength' => 50
@@ -96,7 +96,7 @@
try {
$dbw->insert( 'nl_newsletters', $rowData,
__METHOD__ );
} catch ( DBQueryError $e ) {
- return 'A newsletter with the same name already
exists. Try again with another name';
+ return RequestContext::getMain()->msg(
'newsletter-exist-error' );
}
RequestContext::getMain()->getOutput()->addWikiMsg(
'newsletter-create-confirmation' );
//Add newsletter creator as publisher
@@ -124,6 +124,6 @@
return true;
}
- return 'The Newsletter main page cannot be found. Please try
again';
+ return RequestContext::getMain()->msg(
'newsletter-mainpage-not-found-error' );
}
}
\ No newline at end of file
diff --git a/includes/SpecialNewsletterManage.php
b/includes/SpecialNewsletterManage.php
index e41e43e..2810bfd 100644
--- a/includes/SpecialNewsletterManage.php
+++ b/includes/SpecialNewsletterManage.php
@@ -24,7 +24,7 @@
$announceIssueArray = $this->getAnnounceFormFields();
# Create HTML forms
- $announceIssueForm = new HTMLForm( $announceIssueArray,
$this->getContext(), 'announceissueform' );
+ $announceIssueForm = new HTMLForm( $announceIssueArray,
$this->getContext(), 'newsletter-announceissueform' );
$announceIssueForm->setSubmitCallback( array(
'SpecialNewsletterManage', 'onSubmitIssue' ) );
$table = new NewsletterManageTable();
@@ -103,13 +103,13 @@
'issue-newsletter' => array(
'type' => 'select',
'section' => 'announceissue-section',
- 'label' => 'Name of newsletter',
+ 'label' => $this->msg( 'newsletter-name' ),
'options' => array_merge( $defaultOption,
$newsletterNames ),
),
'issue-page' => array(
'type' => 'text',
'section' => 'announceissue-section',
- 'label' => "Title of issue's main page",
+ 'label' => $this->msg( 'newsletter-issue-title'
),
),
'publisher' => array(
'type' => 'hidden',
@@ -118,13 +118,13 @@
'newsletter-name' => array(
'type' => 'select',
'section' => 'addpublisher-section',
- 'label' => 'Name of newsletter',
+ 'label' => $this->msg( 'newsletter-name' ),
'options' => array_merge( $defaultOption,
$ownedNewsletter ),
),
'publisher-name' => array(
'section' => 'addpublisher-section',
'type' => 'text',
- 'label' => "Username",
+ 'label' => $this->msg(
'newsletter-publisher-username' ),
)
);
}
@@ -162,7 +162,7 @@
'issue_publisher_id' =>
$formData['publisher']
);
$dbw->insert( 'nl_issues', $rowData, __METHOD__
);
-
RequestContext::getMain()->getOutput()->addWikiMsg(
'issue-announce-confirmation' );
+
RequestContext::getMain()->getOutput()->addWikiMsg(
'newsletter-issue-announce-confirmation' );
//trigger notifications
$res = $dbr->select(
'nl_newsletters',
@@ -190,7 +190,7 @@
return true;
} else {
- return 'The Newsletter issue page cannot be
found. Please try again';
+ return RequestContext::getMain()->msg(
'newsletter-issuepage-not-found-error' );
}
}
@@ -205,19 +205,19 @@
);
try {
$dbww->insert('nl_publishers',
$rowData, __METHOD__);
-
RequestContext::getMain()->getOutput()->addWikiMsg(
'new-publisher-confirmation' );
+
RequestContext::getMain()->getOutput()->addWikiMsg(
'newsletter-new-publisher-confirmation' );
return true;
} catch ( DBQueryError $e ) {
- return "Invalid username";
+ return RequestContext::getMain()->msg(
'newsletter-invalid-username-error' );
}
} else {
- return "The provided username does not have a
confirmed email address !";
+ return RequestContext::getMain()->msg(
'newsletter-unconfirmed-email-error' );
}
}
- return "Required fields are empty.";
+ return RequestContext::getMain()->msg(
'newsletter-required-fields-error' );
}
}
@@ -230,7 +230,7 @@
if ( is_null( $header ) ) {
$header = array();
foreach ( SpecialNewsletterManage::$fields as $key =>
$value ) {
- $header[$key]= $this->msg(
"newslettermanage-header-$value" )->text();
+ $header[$key]= $this->msg(
"newsletter-manage-header-$value" )->text();
}
}
@@ -301,7 +301,7 @@
'id' =>
'newslettermanage',
'checked' =>
self::$newsletterOwners[$this->mCurrentRow->newsletter_id]
===
$this->mCurrentRow->publisher_id ? true : false,
)
- ) . $this->msg(
'owner-radiobutton-label' );
+ ) . $this->msg(
'newsletter-owner-radiobutton-label' );
$radioPublisher = HTML::element(
'input',
@@ -311,7 +311,7 @@
'id' =>
'newslettermanage',
'checked' =>
self::$newsletterOwners[$this->mCurrentRow->newsletter_id]
===
$this->mCurrentRow->publisher_id ? false : true,
)
- ) . $this->msg(
'publisher-radiobutton-label' );
+ ) . $this->msg(
'newsletter-publisher-radiobutton-label' );
return $radioOwner . $radioPublisher;
case 'action' :
diff --git a/includes/SpecialNewsletters.php b/includes/SpecialNewsletters.php
index 52ce13c..a98796e 100644
--- a/includes/SpecialNewsletters.php
+++ b/includes/SpecialNewsletters.php
@@ -144,7 +144,7 @@
'checked' => in_array(
$this->mCurrentRow->nl_id,
SpecialNewsletters::$subscribedNewsletterId ) ? true : false,
)
- ).$this->msg( 'subscribe-button-label'
);
+ ).$this->msg(
'newsletter-subscribe-button-label' );
$radioUnSubscribe = Html::element(
'input',
array(
@@ -154,7 +154,7 @@
'checked' => in_array(
$this->mCurrentRow->nl_id,
SpecialNewsletters::$subscribedNewsletterId ) ? false : true,
)
- ).$this->msg( 'unsubscribe-button-label' );
+ ).$this->msg(
'newsletter-unsubscribe-button-label' );
return $radioSubscribe . $radioUnSubscribe;
}
--
To view, visit https://gerrit.wikimedia.org/r/231756
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I504a29b2de43c19356a3b452f537188da4dda186
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Tinaj1234 <[email protected]>
Gerrit-Reviewer: Raimond Spekking <[email protected]>
Gerrit-Reviewer: Se4598 <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits