jenkins-bot has submitted this change and it was merged.
Change subject: (bug 45540) Add tooltips to the proofread and edit buttons
......................................................................
(bug 45540) Add tooltips to the proofread and edit buttons
This adds on-hover tooltips to the proofread and edit buttons
in proofread mode.
This doesn't yet handle the "first proofreading" scenario.
Change-Id: I5c962cb983f5ffe3625748bd985850f29579c946
---
M Translate.i18n.php
M Translate.php
M resources/js/ext.translate.proofread.js
3 files changed, 28 insertions(+), 6 deletions(-)
Approvals:
Nikerabbit: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Translate.i18n.php b/Translate.i18n.php
index bfe8f93..8f49772 100644
--- a/Translate.i18n.php
+++ b/Translate.i18n.php
@@ -468,6 +468,8 @@
'tux-editor-translate-mode' => 'List',
'tux-editor-proofreading-hide-own-translations' => 'Hide your
translations',
'tux-editor-proofreading-show-own-translations' => 'Show your
translations',
+ 'tux-proofread-action-tooltip' => 'Accept translation',
+ 'tux-proofread-edit-tooltip' => 'Translate',
'tux-editor-page-mode' => 'Page',
'tux-editor-outdated-warning' => 'This translation may need to be
updated.',
'tux-editor-outdated-warning-diff-link' => 'Show differences',
@@ -496,7 +498,6 @@
'tux-editor-expand-tooltip' => 'Expand',
'tux-editor-collapse-tooltip' => 'Collapse',
'tux-editor-loading' => 'Loading...',
-
);
/** Message documentation (Message documentation)
@@ -990,6 +991,8 @@
See also:
* {{msg-mw|Tux-editor-proofreading-hide-own-translations}}",
+ 'tux-proofread-action-tooltip' => 'A tooltip shown to new users next to
the button that performs the proofreading.',
+ 'tux-proofread-edit-tooltip' => 'A tooltip shown to new users next to
the translation button in proofreading mode.',
'tux-editor-page-mode' => 'Label for the button that appears at the
footer of the translation editor.
Pressing the button goes to the page mode.
{{Identical|Page}}',
diff --git a/Translate.php b/Translate.php
index 577db57..08ab5ef 100644
--- a/Translate.php
+++ b/Translate.php
@@ -257,6 +257,7 @@
'mediawiki.user',
'mediawiki.jqueryMsg',
'jquery.makeCollapsible',
+ 'jquery.tipsy',
),
'messages' => array(
'tux-status-translated',
@@ -289,6 +290,8 @@
'translate-edit-askpermission',
'tux-editor-outdated-warning',
'tux-editor-outdated-warning-diff-link',
+ 'tux-proofread-action-tooltip',
+ 'tux-proofread-edit-tooltip',
'tux-editor-close-tooltip',
'tux-editor-expand-tooltip',
'tux-editor-collapse-tooltip',
diff --git a/resources/js/ext.translate.proofread.js
b/resources/js/ext.translate.proofread.js
index bb06d01..92a304c 100644
--- a/resources/js/ext.translate.proofread.js
+++ b/resources/js/ext.translate.proofread.js
@@ -138,12 +138,22 @@
},
render: function () {
- var targetLanguage, targetLanguageDir, sourceLanguage,
sourceLanguageDir;
+ var targetLanguage, targetLanguageDir, sourceLanguage,
sourceLanguageDir,
+ $proofreadAction, $proofreadEdit;
sourceLanguage = this.$container.data( 'sourcelangcode'
);
sourceLanguageDir = $.uls.data.getDir( sourceLanguage );
targetLanguage = this.$container.data( 'targetlangcode'
);
targetLanguageDir = $.uls.data.getDir( targetLanguage );
+
+ $proofreadAction = $( '<div>' )
+ .attr( 'title', mw.msg(
'tux-proofread-action-tooltip' ) )
+ .addClass(
+ 'tux-proofread-action ' +
this.message.properties.status
+ );
+ $proofreadEdit = $( '<div>' )
+ .attr( 'title', mw.msg(
'tux-proofread-edit-tooltip' ) )
+ .addClass( 'tux-proofread-edit' );
this.$message.append(
$( '<div>' )
@@ -165,19 +175,25 @@
$( '<div>' )
.addClass( 'tux-proofread-action-block
one column' )
.append(
- $( '<div>' )
- .addClass(
'tux-proofread-action ' + this.message.properties.status ),
+ $proofreadAction,
this.message.properties.reviewers ?
$( '<div>' )
.addClass(
'tux-proofread-count right' )
.text(
mw.language.convertNumber(
this.message.properties.reviewers.length ) ) :
$( [] ),
- $( '<div>' )
- .addClass(
'tux-proofread-edit' )
+ $proofreadEdit
)
)
.addClass( this.message.properties.status );
+
+ $proofreadAction.tipsy( {
+ gravity: 's'
+ } );
+
+ $proofreadEdit.tipsy( {
+ gravity: 'n'
+ } );
},
hide: function () {
--
To view, visit https://gerrit.wikimedia.org/r/53039
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5c962cb983f5ffe3625748bd985850f29579c946
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Pginer <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits