Index: trunk/extensions/Translate/TranslateHooks.php |
— | — | @@ -331,8 +331,9 @@ |
332 | 332 | /** |
333 | 333 | * Hook: ParserFirstCallInit |
334 | 334 | */ |
335 | | - public static function translationDialogMagicWord( Parser $parser, $title = '' ) { |
| 335 | + public static function translationDialogMagicWord( Parser $parser, $title = '', $linktext = '' ) { |
336 | 336 | $title = Title::newFromText( $title ); |
| 337 | + if ( !$title ) return ''; |
337 | 338 | $handle = new MessageHandle( $title ); |
338 | 339 | $group = $handle->getGroup(); |
339 | 340 | $callParams = array( $title->getPrefixedText(), $group->getId() ); |
— | — | @@ -348,7 +349,10 @@ |
349 | 350 | 'onclick' => $js, |
350 | 351 | ); |
351 | 352 | |
352 | | - $output = Html::element( 'a', $a, wfMessage( 'translate-edit-jsopen' )->text() ); |
| 353 | + if ( $linktext === '' ) { |
| 354 | + $linktext = wfMessage( 'translate-edit-jsopen' )->text(); |
| 355 | + } |
| 356 | + $output = Html::element( 'a', $a, $linktext ); |
353 | 357 | return $parser->insertStripItem( $output, $parser->mStripState ); |
354 | 358 | } |
355 | 359 | |