r80444 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80443‎ | r80444 | r80445 >
Date:14:20, 17 January 2011
Author:roberthl
Status:deferred
Tags:
Comment:
Translate: Refactor pre-save transform hook to use functions for title comparison, rather than manual comparison.
Modified paths:
  • /trunk/extensions/Translate/TranslateEditAddons.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/TranslateEditAddons.php
@@ -475,9 +475,10 @@
476476 }
477477
478478 public static function disablePreSaveTransform( $article, $popts ) {
479 - global $wgTranslateMessageNamespaces, $wgTranslateDocumentationLanguageCode;
480 - if( in_array( $article->getTitle()->getNamespace(), $wgTranslateMessageNamespaces )
481 - && $article->getTitle()->getSubpageText() !== $wgTranslateDocumentationLanguageCode ) {
 479+ global $wgTranslateDocumentationLanguageCode;
 480+ $keycodegroup = self::getKeyCodeGroup( $article->getTitle() );
 481+ if( self::isMessageNamespace( $article->getTitle() )
 482+ && $keycodegroup[1] !== $wgTranslateDocumentationLanguageCode ) {
482483 $popts->setPreSaveTransform( false );
483484 }
484485 return true;

Status & tagging log