jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/404718 )
Change subject: EditPage: Match the Save/Publish button's tooltip to its label
......................................................................
EditPage: Match the Save/Publish button's tooltip to its label
Change 9ca9c7ee931ec7fde5518d91593a69b16d98b13d introduced the
localisation messages for this, but they were never used.
If $wgEditSubmitButtonLabelPublish is true, the button will now use
'tooltip-publish' for title and 'accesskey-publish' for accesskey.
Bug: T185071
Change-Id: I7dd4edf99c97b2b12d8b18603bb29786c72283a5
---
M includes/EditPage.php
1 file changed, 12 insertions(+), 2 deletions(-)
Approvals:
jenkins-bot: Verified
Jforrester: Looks good to me, approved
diff --git a/includes/EditPage.php b/includes/EditPage.php
index 6b02c0f..72c3c14 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -4392,7 +4392,11 @@
public function getEditButtons( &$tabindex ) {
$buttons = [];
+ $labelAsPublish =
+ $this->context->getConfig()->get(
'EditSubmitButtonLabelPublish' );
+
$buttonLabel = $this->context->msg(
$this->getSubmitButtonLabel() )->text();
+ $buttonTooltip = $labelAsPublish ? 'publish' : 'save';
$buttons['save'] = new OOUI\ButtonInputWidget( [
'name' => 'wpSave',
@@ -4405,8 +4409,10 @@
'label' => $buttonLabel,
'infusable' => true,
'type' => 'submit',
- 'title' => Linker::titleAttrib( 'save' ),
- 'accessKey' => Linker::accesskey( 'save' ),
+ // Messages used: tooltip-save, tooltip-publish
+ 'title' => Linker::titleAttrib( $buttonTooltip ),
+ // Messages used: accesskey-save, accesskey-publish
+ 'accessKey' => Linker::accesskey( $buttonTooltip ),
] );
$buttons['preview'] = new OOUI\ButtonInputWidget( [
@@ -4419,7 +4425,9 @@
'label' => $this->context->msg( 'showpreview' )->text(),
'infusable' => true,
'type' => 'submit',
+ // Message used: tooltip-preview
'title' => Linker::titleAttrib( 'preview' ),
+ // Message used: accesskey-preview
'accessKey' => Linker::accesskey( 'preview' ),
] );
@@ -4433,7 +4441,9 @@
'label' => $this->context->msg( 'showdiff' )->text(),
'infusable' => true,
'type' => 'submit',
+ // Message used: tooltip-diff
'title' => Linker::titleAttrib( 'diff' ),
+ // Message used: accesskey-diff
'accessKey' => Linker::accesskey( 'diff' ),
] );
--
To view, visit https://gerrit.wikimedia.org/r/404718
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7dd4edf99c97b2b12d8b18603bb29786c72283a5
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Tpt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits