Merge "Make Nuke tag translatable"

This commit is contained in:
jenkins-bot 2024-11-14 15:33:32 +00:00 committed by Gerrit Code Review
commit 7cfed13f4f
5 changed files with 19 additions and 9 deletions

View file

@ -33,5 +33,7 @@
"nuke-namespace": "Limit to namespace:",
"nuke-linkoncontribs": "mass delete",
"nuke-linkoncontribs-text": "Mass delete pages where {{GENDER:$1|this user}} is the only author",
"nuke-confirm": "You are about to delete {{PLURAL:$1|one page|$1 pages}}. Are you sure that you want to delete?"
"nuke-confirm": "You are about to delete {{PLURAL:$1|one page|$1 pages}}. Are you sure that you want to delete?",
"tag-nuke": "Nuke",
"tag-nuke-description": "Deletions performed with the Nuke extension"
}

View file

@ -46,5 +46,7 @@
"nuke-namespace": "Label shown on [[Special:Nuke]] in front of the namespace input that allows choosing a namespace to filter the search by",
"nuke-linkoncontribs": "Used as link text which is used on [[Special:Contributions]] and [[Special:DeletedContributions]].\n\nOnly added if a user has rights to nuke pages.\n\nThe link has the tooltip {{msg-mw|Nuke-linkoncontribs-text}}.\n{{Identical|Mass delete}}",
"nuke-linkoncontribs-text": "Tooltip for the link which is labeled {{msg-mw|Nuke-linkoncontribs}} Parameters:\n* $1 is the target username used for GENDER.",
"nuke-confirm": "Message when the user is trying to delete pages."
"nuke-confirm": "Message when the user is trying to delete pages.",
"tag-nuke": "Short description of the nuke tag.\n\nShown on lists of changes (history, recentchanges, etc.) for each page deleted with the Tag extension.\n\nSee also:\n* {{msg-mw|tag-nuke-description}}",
"tag-nuke-description": "Long description of the nuke tag.\n\nShown on [[Special:Tags]].\n\nSee also:\n* {{msg-mw|tag-nuke}}"
}

View file

@ -38,7 +38,7 @@ class Hooks implements ContributionsToolLinksHook {
* @param string[] &$tags
*/
public static function onRegisterTags( array &$tags ): bool {
$tags[] = 'Nuke';
$tags[] = 'nuke';
return true;
}
}

View file

@ -637,7 +637,7 @@ class SpecialNuke extends SpecialPage {
'userId' => $user->getId(),
'wikiPageId' => $title->getId(),
'suppress' => false,
'tags' => '["Nuke"]',
'tags' => '["nuke"]',
'logsubtype' => 'delete',
] );
$jobs[] = $job;

View file

@ -739,13 +739,18 @@ class SpecialNukeTest extends SpecialPageTestBase {
$this->assertStringContainsString( '(nuke-deletion-queued: Page123)', $html );
$this->assertStringContainsString( '(nuke-deletion-queued: Paging456)', $html );
$this->assertStringNotContainsString( 'Nuke', $this->getDeleteLogHtml() );
// Ensure all jobs are run
// Pre-check to confirm that the page hasn't been deleted yet
// "mw-tag-marker-nuke" is the CSS class for the "Nuke" tag's <span> on Special:Log.
$this->assertStringNotContainsString( 'mw-tag-marker-nuke', $this->getDeleteLogHtml() );
// Ensure all delete jobs are run
$this->runJobs();
$this->assertStringContainsString( 'Vandalism', $this->getDeleteLogHtml() );
$this->assertStringContainsString( 'Nuke', $this->getDeleteLogHtml() );
$this->assertStringContainsString( $fauxReason, $this->getDeleteLogHtml() );
$deleteLogHtml = $this->getDeleteLogHtml();
$this->assertStringContainsString( 'Vandalism', $deleteLogHtml );
$this->assertStringContainsString( 'mw-tag-marker-nuke', $deleteLogHtml );
$this->assertStringContainsString( $fauxReason, $deleteLogHtml );
}
public function testDeleteDropdownReason() {
@ -898,6 +903,7 @@ class SpecialNukeTest extends SpecialPageTestBase {
private function getDeleteLogHtml(): string {
$services = $this->getServiceContainer();
// TODO: Make this use qqx so tests can be checked against system message keys.
$specialLog = $services->getSpecialPageFactory()->getPage( 'Log' );
$specialLog->execute( "delete" );
return $specialLog->getOutput()->getHTML();