Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
TranslateToolbox.php
Go to the documentation of this file.
1<?php
24 public static function toolboxAllTranslations( Skin $skin, array &$sidebar ): void {
25 $title = $skin->getTitle();
26 $handle = new MessageHandle( $title );
27
28 if ( !$handle->isValid() ) {
29 return;
30 }
31
32 $message = $title->getNsText() . ':' . $handle->getKey();
33 $url = $skin::makeSpecialUrl( 'Translations', [ 'message' => $message ] );
34
35 // Add the actual toolbox entry.
36 $sidebar['TOOLBOX'][ 'alltrans' ] = [
37 'href' => $url,
38 'id' => 't-alltrans',
39 'msg' => 'translate-sidebar-alltrans',
40 ];
41 }
42}
Class for pointing to messages, like Title class is for titles.
Adds toolbox menu item to Special:Prefixindex to show all other available translations for a message.
static toolboxAllTranslations(Skin $skin, array &$sidebar)