r81360 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81359‎ | r81360 | r81361 >
Date:00:01, 2 February 2011
Author:siebrand
Status:deferred
Tags:
Comment:
Remove broken code that was disabled in translatewiki.net live hack.
Modified paths:
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/TranslateEditAddons.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/TranslateEditAddons.php
@@ -58,8 +58,8 @@
5959 if ( isset( $keys[$index+1] ) ) {
6060 $next = $keys[$index+1];
6161 }
62 -
6362
 63+
6464 $id = $group->getId();
6565 $ns = $title->getNamespace();
6666
@@ -408,39 +408,6 @@
409409 return true;
410410 }
411411
412 - public static function customDisplay( $article, &$content ) {
413 - global $wgRequest, $wgTitle;
414 - if (
415 - $wgRequest->getVal( 'action' ) !== 'edit' &&
416 - $wgTitle instanceof Title && $article->getTitle()->equals( $wgTitle ) &&
417 - self::isMessageNamespace( $article->getTitle() ) )
418 - {
419 - list( $key, $code, $group ) = self::getKeyCodeGroup( $article->getTitle() );
420 - if ( !$group ) return true;
421 -
422 - $def = self::preserveWhitespaces( $group->getMessage( $key, 'en' ) );
423 - $content = self::preserveWhitespaces( $content );
424 -
425 - $deftext = wfMsgNoTrans( 'translate-edit-show-def' );
426 - $trans = wfMsgNoTrans( 'translate-edit-show-trans' );
427 - $click = htmlspecialchars( wfMsgNoTrans( 'translate-edit-show-click' ) );
428 -
429 - $content = <<<HTML
430 -<table class="wikitable translationdisplay" id=tt1 title="$click">
431 - <tr><th>$deftext</th><th>$trans</th></tr>
432 - <tr><td style=vertical-align:top>$def</td><td style=vertical-align:top>$content</td></tr>
433 -</table>
434 -<table class="wikitable translationdisplay" id=tt2 title="$click" style=display:none>
435 - <tr><th>$deftext</th></tr>
436 - <tr><td style=vertical-align:top>$def</td></tr>
437 - <tr><th>$trans</th></tr>
438 - <tr><td style=vertical-align:top>$content</td></tr>
439 -</table>
440 -HTML;
441 - }
442 - return true;
443 - }
444 -
445412 public static function preserveWhitespaces( $text ) {
446413 $text = wfEscapeWikiText( $text );
447414 $text = preg_replace( '/^ /m', '&#160;', $text );
Index: trunk/extensions/Translate/Translate.php
@@ -89,7 +89,6 @@
9090 $wgHooks['EditPageBeforeEditButtons'][] = 'TranslateEditAddons::buttonHack';
9191 $wgHooks['EditPage::showEditForm:fields'][] = 'TranslateEditAddons::keepFields';
9292 $wgHooks['SkinTemplateTabs'][] = 'TranslateEditAddons::tabs';
93 -$wgHooks['ArticleAfterFetchContent'][] = 'TranslateEditAddons::customDisplay';
9493 $wgHooks['ParserBeforeStrip'][] = 'TranslateEditAddons::injectTranslationDisplayJs';
9594 $wgHooks['LanguageGetTranslatedLanguageNames'][] = 'TranslateEditAddons::translateMessageDocumentationLanguage';
9695 $wgHooks['ArticlePrepareTextForEdit'][] = 'TranslateEditAddons::disablePreSaveTransform';

Status & tagging log