From: James D. Forrester Date: Thu, 30 Jun 2016 11:53:26 +0000 (+0100) Subject: EditPage: Show a different label for the button on create vs. modify X-Git-Tag: 1.31.0-rc.0~5923^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=347ec3352801cae78c3c057c2748fe44129c113b 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 --- 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 = [