Index: branches/RL2/extensions/Gadgets/Gadgets.i18n.php |
— | — | @@ -26,6 +26,7 @@ |
27 | 27 | |
28 | 28 | Also note that these special gadgets are not part of the MediaWiki software, and are usually developed and maintained by users on your local wiki. |
29 | 29 | Local administrators can edit the [[MediaWiki:Gadgets-definition|definitions]] and [[Special:Gadgets|descriptions]] of available gadgets.', |
| 30 | + 'gadgets-preference-description' => '$1: $2', |
30 | 31 | |
31 | 32 | # For Special:Gadgets |
32 | 33 | 'gadgets' => 'Gadgets', |
— | — | @@ -98,6 +99,7 @@ |
99 | 100 | |
100 | 101 | {{Identical|Gadgets}}', |
101 | 102 | 'gadgets-prefstext' => 'In Gadgets extension. This is the explanation text displayed under the Gadgets tab in [[Special:Preferences]].', |
| 103 | + 'gadgets-preference-description' => 'Used for the description HTML of a Gadget in Special:Preferences. $1 is the title of the Gadget, $2 is the description of the Gadget.', |
102 | 104 | 'gadgets' => '{{Identical|Gadgets}}', |
103 | 105 | 'gadgets-title' => '{{Identical|Gadgets}}', |
104 | 106 | 'gadgets-uses' => "This is used as a verb in third-person singular. It appears in front of a script name. Example: \"''Uses: Gadget-UTCLiveClock.js''\" |
Index: branches/RL2/extensions/Gadgets/GadgetHooks.php |
— | — | @@ -193,8 +193,15 @@ |
194 | 194 | $category = $gadget->getCategory(); |
195 | 195 | |
196 | 196 | // Add the Gadget to the right category |
197 | | - $description = $gadget->getDescriptionMessage(); |
198 | | - $categories[$category][$description] = $name; |
| 197 | + $title = htmlspecialchars( $gadget->getTitleMessage() ); |
| 198 | + $description = $gadget->getDescriptionMessage(); // Is parsed, doesn't need escaping |
| 199 | + if ( $description === '' ) { |
| 200 | + // Empty description, just use the title |
| 201 | + $text = $title; |
| 202 | + } else { |
| 203 | + $text = wfMessage( 'gadgets-preference-description' )->rawParams( $title, $description )->parse(); |
| 204 | + } |
| 205 | + $categories[$category][$text] = $name; |
199 | 206 | // Add the Gadget to the default list if enabled |
200 | 207 | if ( $gadget->isEnabledForUser( $user ) ) { |
201 | 208 | $default[] = $name; |