Glaisher has uploaded a new change for review.
https://gerrit.wikimedia.org/r/233951
Change subject: Make some hardcoded messages localizable
......................................................................
Make some hardcoded messages localizable
Also use 'label-message' instead of 'label' in HTMLForm fields
Bug: T110023
Change-Id: I6e9fd13a812e042c7fddc671571014d328fac2dc
---
M i18n/en.json
M i18n/qqq.json
M includes/SpecialNewsletterCreate.php
M includes/SpecialNewsletterManage.php
4 files changed, 16 insertions(+), 12 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter
refs/changes/51/233951/1
diff --git a/i18n/en.json b/i18n/en.json
index 8565ddf..0f7b24a 100755
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -25,7 +25,9 @@
"newsletter-announceissueform-announceissue-section": "Announce new
issue",
"newsletter-announceissueform-addpublisher-section": "Add publishers",
"newsletter-create-section": "Create newsletter",
+ "newsletter-create-submit": "Create newsletter",
"newsletter-create-confirmation": "Good job! You just created a new
newsletter.",
+ "newsletter-create-mainpage-error": "Unknown Newsletter main page
entered. Please try again",
"newsletter-issue-announce-confirmation": "Good job! You just announced
a new issue of your newsletter.",
"newsletters": "Newsletters",
"newsletter-subscribe-section": "Subscribe newsletters",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index f6c4ee5..56fb512 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -26,7 +26,9 @@
"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-submit": "Label of submit button on
[[Special:NewsletterCreate]]",
"newsletter-create-confirmation": "Confirmation message displayed after
creation of a newsletter",
+ "newsletter-create-mainpage-error": "Error message shown on
[[Special:NewsletterCreate]] if the page entered on main page field does not
exist.",
"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\n{{Identical|Newsletter}}",
"newsletter-subscribe-section": "Section header of HTML form in
[[Special:Newsletters]] which allows users to subscribe.",
diff --git a/includes/SpecialNewsletterCreate.php
b/includes/SpecialNewsletterCreate.php
index 4f786b7..a01fc79 100644
--- a/includes/SpecialNewsletterCreate.php
+++ b/includes/SpecialNewsletterCreate.php
@@ -16,7 +16,7 @@
# Create HTML forms
$createNewsletterForm = new HTMLForm( $createNewsletterArray,
$this->getContext(), 'createnewsletterform' );
- $createNewsletterForm->setSubmitText( 'Create newsletter' );
+ $createNewsletterForm->setSubmitTextMsg(
'newsletter-create-submit' );
$createNewsletterForm->setSubmitCallback( array(
'SpecialNewsletterCreate', 'onSubmitNewsletter' ) );
$createNewsletterForm->setWrapperLegendMsg(
'newsletter-create-section' );
# Show HTML forms
@@ -34,24 +34,24 @@
'name' => array(
'type' => 'text',
'required' => true,
- 'label' => $this->msg( 'newsletter-name' )
+ 'label-message' => 'newsletter-name',
),
'description' => array(
'type' => 'textarea',
'required' => true,
- 'label' => $this->msg( 'newsletter-desc' ),
+ 'label-message' => 'newsletter-desc',
'rows' => 15,
'cols' => 50,
),
'mainpage' => array(
'required' => true,
'type' => 'text',
- 'label' => $this->msg( 'newsletter-title' )
+ 'label-message' => 'newsletter-title',
),
'frequency' => array(
'required' => true,
'type' => 'selectorother',
- 'label' => $this->msg( 'newsletter-frequency' ),
+ 'label-message' => 'newsletter-frequency',
'options' => array(
'weekly' => $this->msg(
'newsletter-option-weekly' ),
'monthly' => $this->msg(
'newsletter-option-monthly' ),
@@ -79,7 +79,7 @@
$page = Title::newFromText( $formData['mainpage'] );
$pageId = $page->getArticleId();
} else {
- return 'Unknown Newsletter main page entered. Please
try again';
+ return RequestContext::getMain()->msg(
'newsletter-create-mainpage-error' );
}
if ( isset( $formData['name'] ) && isset(
$formData['description'] ) && ( $pageId !== 0 ) &&
isset( $formData['mainpage'] ) && isset(
$formData['frequency'] ) && isset( $formData['publisher'] ) ) {
@@ -126,4 +126,4 @@
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 2810bfd..f804511 100644
--- a/includes/SpecialNewsletterManage.php
+++ b/includes/SpecialNewsletterManage.php
@@ -103,13 +103,13 @@
'issue-newsletter' => array(
'type' => 'select',
'section' => 'announceissue-section',
- 'label' => $this->msg( 'newsletter-name' ),
+ 'label-message' => 'newsletter-name',
'options' => array_merge( $defaultOption,
$newsletterNames ),
),
'issue-page' => array(
'type' => 'text',
'section' => 'announceissue-section',
- 'label' => $this->msg( 'newsletter-issue-title'
),
+ 'label-message' => 'newsletter-issue-title',
),
'publisher' => array(
'type' => 'hidden',
@@ -118,13 +118,13 @@
'newsletter-name' => array(
'type' => 'select',
'section' => 'addpublisher-section',
- 'label' => $this->msg( 'newsletter-name' ),
+ 'label-message' => 'newsletter-name',
'options' => array_merge( $defaultOption,
$ownedNewsletter ),
),
'publisher-name' => array(
'section' => 'addpublisher-section',
'type' => 'text',
- 'label' => $this->msg(
'newsletter-publisher-username' ),
+ 'label-message' =>
'newsletter-publisher-username',
)
);
}
@@ -345,4 +345,4 @@
return false;
}
-}
\ No newline at end of file
+}
--
To view, visit https://gerrit.wikimedia.org/r/233951
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e9fd13a812e042c7fddc671571014d328fac2dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Glaisher <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits