From 19690f3940138e4937618b88992cad25dcba7f0e Mon Sep 17 00:00:00 2001 From: AntiCompositeNumber Date: Sat, 22 Jan 2022 20:29:21 -0500 Subject: HistoryAction: use more specific tooltip for cur and last links Bug: T284869 Change-Id: Ie09276b8ac8b003251141f154c10cac1dec6fb24 --- includes/actions/HistoryAction.php | 2 +- includes/actions/pagers/HistoryPager.php | 12 +++++++++--- languages/i18n/en.json | 2 ++ languages/i18n/qqq.json | 2 ++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 35fedd74772e..3e85516c6acb 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -89,7 +89,7 @@ class HistoryAction extends FormlessAction { // Precache various messages if ( !isset( $this->message ) ) { $this->message = []; - $msgs = [ 'cur', 'last', 'pipe-separator' ]; + $msgs = [ 'cur', 'tooltip-cur', 'last', 'tooltip-last', 'pipe-separator' ]; foreach ( $msgs as $msg ) { $this->message[$msg] = $this->msg( $msg )->escaped(); } diff --git a/includes/actions/pagers/HistoryPager.php b/includes/actions/pagers/HistoryPager.php index f3cbb096493d..06bb2982f294 100644 --- a/includes/actions/pagers/HistoryPager.php +++ b/includes/actions/pagers/HistoryPager.php @@ -594,7 +594,9 @@ class HistoryPager extends ReverseChronologicalPager { return $this->getLinkRenderer()->makeKnownLink( $this->getTitle(), new HtmlArmor( $cur ), - [], + [ + 'title' => $this->historyPage->message['tooltip-cur'] + ], [ 'diff' => $latest, 'oldid' => $rev->getId() @@ -626,7 +628,9 @@ class HistoryPager extends ReverseChronologicalPager { return $linkRenderer->makeKnownLink( $this->getTitle(), new HtmlArmor( $last ), - [], + [ + 'title' => $this->historyPage->message['tooltip-last'] + ], [ 'diff' => $prevRev->getId(), 'oldid' => 'prev' @@ -649,7 +653,9 @@ class HistoryPager extends ReverseChronologicalPager { return $linkRenderer->makeKnownLink( $this->getTitle(), new HtmlArmor( $last ), - [], + [ + 'title' => $this->historyPage->message['tooltip-last'] + ], [ 'diff' => $prevRev->getId(), 'oldid' => $next->rev_id diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 506e9a3cc7fc..9e28d3127d81 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -848,8 +848,10 @@ "nextrevision": "Newer revision →", "currentrevisionlink": "Latest revision", "cur": "cur", + "tooltip-cur": "Difference with latest revision", "next": "next", "last": "prev", + "tooltip-last": "Difference with preceding revision", "page_first": "first", "page_last": "last", "histlegend": "Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
\nLegend: ({{int:cur}}) = difference with latest revision, ({{int:last}}) = difference with preceding revision, {{int:minoreditletter}} = minor edit.", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 7802e85b5abc..c26cd07fc766 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -1080,8 +1080,10 @@ "nextrevision": "See also:\n* {{msg-mw|Previousrevision}}", "currentrevisionlink": "{{Identical|Current revision}}", "cur": "Link in page history ([https://translatewiki.net/w/i.php?title=MediaWiki:Cur/qqq&action=history example]).\n\nThis is short for \"current\".", + "tooltip-cur": "Tooltip for {{msg-mw|cur}} link in page history. Should match entry in {{msg-mw|histlegend}}", "next": "Link in page history\n\n{{Identical|Next}}", "last": "Link in page history", + "tooltip-last": "Tooltip for {{msg-mw|last}} link in page history. Should match entry in {{msg-mw|histlegend}}", "page_first": "This is part of the navigation message on the top and bottom of Special pages which are lists of things in alphabetical order, e.g. the '[[Special:Categories|Categories]]' special page. It is followed by the message {{msg-mw|Viewprevnext}}.\n{{Identical|First}}", "page_last": "This is part of the navigation message on the top and bottom of Special pages which are lists of things in alphabetical order, e.g. the '[[Special:Categories|Categories]]' special page. It is followed by the message {{msg-mw|Viewprevnext}}.\n\n{{Identical|Last}}", "histlegend": "Text at the top of the history page, explaining how to use it.\n\nOne or two [[:w:en:Radio button|radio buttons]] appear in each row that represents a revision of a wiki page.\n\n\"Legend\" means \"explanation of symbols\".\n\nSee also:\n* {{msg-mw|Cur}}\n* {{msg-mw|Last}}\n* {{msg-mw|Minoreditletter}}\n\nScreenshot:\n[[File:Screenshot of Revision history of Douglas Adams (Q42) - Wikidata.png|thumb|Screenshot of the revision history feature]]", -- cgit v1.2.3