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
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 = [