From 9ebc94191a6a698f822111c3ec2257fdd5a554b2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Mon, 29 May 2017 20:46:24 +0200 Subject: [PATCH] EditPage: Fix passing the save/publish button label to other messages We were passing the message key, instead of the message text. Follow-up to 44f596231397eb9ea2a5fe345c79ae952d6a1247. Bug: T166478 Change-Id: Iaf33b0e6fba71ebf1130fc067210ed49c1b06011 --- includes/EditPage.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 098ffbf791..3e8473d431 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2908,7 +2908,7 @@ class EditPage { } } - $buttonLabelKey = $this->getSaveButtonLabel(); + $buttonLabel = $this->context->msg( $this->getSaveButtonLabel() )->text(); if ( $this->missingComment ) { $wgOut->wrapWikiMsg( "
\n$1\n
", 'missingcommenttext' ); @@ -2917,28 +2917,28 @@ class EditPage { if ( $this->missingSummary && $this->section != 'new' ) { $wgOut->wrapWikiMsg( "
\n$1\n
", - [ 'missingsummary', $buttonLabelKey ] + [ 'missingsummary', $buttonLabel ] ); } if ( $this->missingSummary && $this->section == 'new' ) { $wgOut->wrapWikiMsg( "
\n$1\n
", - [ 'missingcommentheader', $buttonLabelKey ] + [ 'missingcommentheader', $buttonLabel ] ); } if ( $this->blankArticle ) { $wgOut->wrapWikiMsg( "
\n$1\n
", - [ 'blankarticle', $buttonLabelKey ] + [ 'blankarticle', $buttonLabel ] ); } if ( $this->selfRedirect ) { $wgOut->wrapWikiMsg( "
\n$1\n
", - [ 'selfredirect', $buttonLabelKey ] + [ 'selfredirect', $buttonLabel ] ); } @@ -4327,7 +4327,7 @@ HTML public function getEditButtons( &$tabindex ) { $buttons = []; - $buttonLabelKey = $this->getSaveButtonLabel(); + $buttonLabel = $this->context->msg( $this->getSaveButtonLabel() )->text(); $attribs = [ 'id' => 'wpSave', @@ -4341,13 +4341,13 @@ HTML // Support: IE 6 – Use , otherwise it can't distinguish which button was clicked 'useInputTag' => true, 'flags' => [ 'constructive', 'primary' ], - 'label' => $this->context->msg( $buttonLabelKey )->text(), + 'label' => $buttonLabel, 'infusable' => true, 'type' => 'submit', ] + $saveConfig ); } else { $buttons['save'] = Html::submitButton( - $this->context->msg( $buttonLabelKey )->text(), + $buttonLabel, $attribs, [ 'mw-ui-progressive' ] ); @@ -4697,7 +4697,7 @@ HTML protected function addExplainConflictHeader( OutputPage $out ) { $out->wrapWikiMsg( "
\n$1\n
", - [ 'explainconflict', $this->getSaveButtonLabel() ] + [ 'explainconflict', $this->context->msg( $this->getSaveButtonLabel() )->text() ] ); } -- 2.20.1