Merge "Change message on Special:Wantedfiles based on if foreign repo on."

This commit is contained in:
jenkins-bot 2014-07-10 19:29:55 +00:00 committed by Gerrit Code Review
commit 5ca4bea3d3
3 changed files with 29 additions and 4 deletions

View file

@ -49,23 +49,44 @@ class WantedFilesPage extends WantedQueryPage {
$category = false;
}
$noForeign = '';
if ( !$this->likelyToHaveFalsePositives() ) {
// Additional messages for grep:
// wantedfiletext-cat-noforeign, wantedfiletext-nocat
$noForeign = '-noforeign';
}
if ( $category ) {
return $this
->msg( 'wantedfiletext-cat' )
->msg( 'wantedfiletext-cat' . $noForeign )
->params( $category->getFullText() )
->parseAsBlock();
} else {
return $this
->msg( 'wantedfiletext-nocat' )
->msg( 'wantedfiletext-nocat' . $noForeign )
->parseAsBlock();
}
}
/**
* Whether foreign repos are likely to cause false positives
*
* In its own function to allow subclasses to override.
* @see SpecialWantedFilesGUOverride in GlobalUsage extension.
* @since 1.24
*/
protected function likelyToHaveFalsePositives() {
return RepoGroup::singleton()->hasForeignRepos();
}
/**
* KLUGE: The results may contain false positives for files
* that exist e.g. in a shared repo. Setting this at least
* keeps them from showing up as redlinks in the output, even
* if it doesn't fix the real problem (bug 6220).
*
* @note could also have existing links here from broken file
* redirects.
* @return bool
*/
function forceExistenceCheck() {

View file

@ -1599,7 +1599,9 @@
"wantedfiles": "Wanted files",
"wantedfiles-summary": "",
"wantedfiletext-cat": "The following files are used but do not exist. Files from foreign repositories may be listed despite existing. Any such false positives will be <del>struck out</del>. Additionally, pages that embed files that do not exist are listed in [[:$1]].",
"wantedfiletext-cat-noforeign": "The following files are used but do not exist. Additionally, pages that embed files that do not exist are listed in [[:$1]].",
"wantedfiletext-nocat": "The following files are used but do not exist. Files from foreign repositories may be listed despite existing. Any such false positives will be <del>struck out</del>.",
"wantedfiletext-nocat-noforeign": "The following files are used but do not exist.",
"wantedtemplates": "Wanted templates",
"wantedtemplates-summary": "",
"mostlinked": "Most linked-to pages",

View file

@ -1761,8 +1761,10 @@
"wantedpages-badtitle": "Error message shown when [[Special:WantedPages]] is listing a page with a title that shouldn't exist.\n\nParameters:\n* $1 - a page title",
"wantedfiles": "{{doc-special|WantedFiles}}",
"wantedfiles-summary": "{{doc-specialpagesummary|wantedfiles}}",
"wantedfiletext-cat": "Message displayed at top of [[special:WantedFiles]]. $1 contains the name of the tracking category for broken files (Including Category prefix). {{msg-mw|wantedfiletext-nocat}} is used if the tracking category is disabled.",
"wantedfiletext-nocat": "Message displayed at top of [[special:WantedFiles]] when broken file tracking category is disabled. See {{msg-mw|wantedfiletext-cat}}.",
"wantedfiletext-cat": "Message displayed at top of [[special:WantedFiles]] when false positives from foreign file repositories (like commons) are likely. $1 contains the name of the tracking category for broken files (Including Category prefix). {{msg-mw|wantedfiletext-nocat}} is used if the tracking category is disabled.\n\nSee also: {{msg-mw|wantedfiletext-cat-noforeign}}, {{msg-mw|wantedfiletext-nocat}}",
"wantedfiletext-cat-noforeign": "Message displayed at top of [[special:WantedFiles]] when the wiki has no foreign repositories. See also {{mwg-mw|wantedfilestext-cat}}. $1 contains the name of the tracking category for broken files (Including Category prefix). {{msg-mw|wantedfiletext-nocat}} is used if the tracking category is disabled.",
"wantedfiletext-nocat": "Message displayed at top of [[special:WantedFiles]] when broken file tracking category is disabled and false positives from foreign file repositories (like commons) are likely. See {{msg-mw|wantedfiletext-cat}}.",
"wantedfiletext-nocat-noforeign": "Message displayed at top of [[special:WantedFiles]] when broken file tracking category is disabled and their are no foreign file repositories enabled on the wiki. See {{msg-mw|wantedfiletext-cat}}, {{msg-mw|wantedfiletext-nocat}}.",
"wantedtemplates": "{{doc-special|WantedTemplates}}",
"wantedtemplates-summary": "{{doc-specialpagesummary|wantedtemplates}}",
"mostlinked": "{{doc-special|MostLinked}}",