From 347ec3352801cae78c3c057c2748fe44129c113b Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Thu, 30 Jun 2016 12:53:26 +0100 Subject: [PATCH] EditPage: Show a different label for the button on create vs. modify This is exceedingly common in CMS software, and it was noted in the work on T131132 that MediaWiki is unusual in not differentiating these cases. Bug: T139033 Change-Id: Ie81b5edd275963a965cd44d0fd325cae9ee2f1a6 --- includes/EditPage.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 2a80ea68d8..7f9414024e 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -4032,13 +4032,14 @@ HTML public function getEditButtons( &$tabindex ) { $buttons = []; + $buttonLabelKey = $this->isNew ? 'savearticle' : 'savechanges'; + $buttonLabel = wfMessage( $buttonLabelKey )->text(); $attribs = [ 'id' => 'wpSave', 'name' => 'wpSave', 'tabindex' => ++$tabindex, ] + Linker::tooltipAndAccesskeyAttribs( 'save' ); - $buttons['save'] = Html::submitButton( wfMessage( 'savearticle' )->text(), - $attribs, [ 'mw-ui-constructive' ] ); + $buttons['save'] = Html::submitButton( $buttonLabel, $attribs, [ 'mw-ui-constructive' ] ); ++$tabindex; // use the same for preview and live preview $attribs = [ -- 2.20.1