From 5abf6fca4fbd64fabce9d16100e793c3409bbd4c Mon Sep 17 00:00:00 2001 From: MatmaRex Date: Wed, 10 Jul 2013 19:13:13 +0200 Subject: [PATCH] Show small explanation next to lists of tags Lists of tags are shown on recent changes, watchlists, history pages and diffs. However, it's hard to tell what they are, as they have no visual indicators and resemble edit summaries (they looks examply the same sans the italics). Wikimedia wikis have been using various methods to remedy that (a "Tag:" prefix in every tag message, yellow background color, etc.). This basically implements the first one: a link to Special:Tags and "Tag(s):" text is shown before the list of tags everywhere it's shown. The text is correctly pluralized depending on the number of tags given revision has. Change-Id: If21eaed4171e732daaee32087c3307d70b60d81f --- includes/ChangeTags.php | 5 ++++- languages/messages/MessagesEn.php | 1 + languages/messages/MessagesQqq.php | 5 +++++ maintenance/language/messages.inc | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/includes/ChangeTags.php b/includes/ChangeTags.php index 54783966a4..32440f5df4 100644 --- a/includes/ChangeTags.php +++ b/includes/ChangeTags.php @@ -54,7 +54,10 @@ class ChangeTags { ); $classes[] = Sanitizer::escapeClass( "mw-tag-$tag" ); } - $markers = wfMessage( 'parentheses' )->rawParams( $wgLang->commaList( $displayTags ) )->text(); + $markers = wfMessage( 'tag-list-wrapper' ) + ->numParams( count( $displayTags ) ) + ->rawParams( $wgLang->commaList( $displayTags ) ) + ->parse(); $markers = Xml::tags( 'span', array( 'class' => 'mw-tag-markers' ), $markers ); return array( $markers, $classes ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index d675e178ec..d7477564eb 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -4893,6 +4893,7 @@ You should have received [{{SERVER}}{{SCRIPTPATH}}/COPYING a copy of the GNU Gen 'tags-summary' => '', # do not translate or duplicate this message to other languages 'tag-filter' => '[[Special:Tags|Tag]] filter:', 'tag-filter-submit' => 'Filter', +'tag-list-wrapper' => '([[Special:Tags|{{PLURAL:$1|Tag|Tags}}]]: $2)', 'tags-title' => 'Tags', 'tags-intro' => 'This page lists the tags that the software may mark an edit with, and their meaning.', 'tags-tag' => 'Tag name', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 7582c6c1f5..a7a612a972 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -8789,6 +8789,11 @@ It appears that the word 'valid' describes 'tags', not 'change'. It also appears 'tag-filter-submit' => 'Caption of the submit button displayed next to the tag filter on lists of changes (e.g. [[Special:Log]], [[Special:Contributions]], [[Special:Newpages]], [[Special:Recentchanges]], [[Special:Recentchangeslinked]], page histories) {{Identical|Filter}}', +'tag-list-wrapper' => 'Wrapper for the list of tags shown on recent changes, watchlists, history pages and diffs. + +Parameters: +* $1 - number of distinct tags for given edit +* $2 - comma-separated list of tags for given edit', 'tags-title' => 'The title of [[Special:Tags]]', 'tags-intro' => 'Explanation on top of [[Special:Tags]]. For more information on tags see [[mw:Manual:Tags|MediaWiki]].', 'tags-tag' => 'Caption of a column in [[Special:Tags]]. For more information on tags see [[mw:Manual:Tags|MediaWiki]].', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 2cb94cf449..9328144a26 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -3732,6 +3732,7 @@ $wgMessageStructure = array( 'tags-summary', 'tag-filter', 'tag-filter-submit', + 'tag-list-wrapper', 'tags-title', 'tags-intro', 'tags-tag', -- 2.20.1