r96232 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96231‎ | r96232 | r96233 >
Date:16:09, 4 September 2011
Author:robin
Status:ok
Tags:
Comment:
Mark $mDiffLang protected, and rename function to setTextLanguage per Nikerabbit on r92956
Modified paths:
  • /trunk/extensions/Translate/tag/SpecialPageTranslation.php (modified) (history)
  • /trunk/extensions/Translate/utils/TranslationHelpers.php (modified) (history)
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -25,7 +25,7 @@
2626 var $mOldid, $mNewid;
2727 var $mOldtitle, $mNewtitle, $mPagetitle;
2828 var $mOldtext, $mNewtext;
29 - var $mDiffLang;
 29+ protected $mDiffLang;
3030
3131 /**
3232 * @var Title
@@ -981,7 +981,7 @@
982982 * (Defaults to page content language).
983983 * @since 1.19
984984 */
985 - function setDiffLang( $lang ) {
 985+ function setTextLanguage( $lang ) {
986986 $this->mDiffLang = wfGetLangObj( $lang );
987987 }
988988
Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php
@@ -380,8 +380,8 @@
381381
382382 if ( $s->type === 'changed' ) {
383383 $diff = new DifferenceEngine;
384 - if ( method_exists( 'DifferenceEngine', 'setDiffLang' ) ) {
385 - $diff->setDiffLang( $wgContLang );
 384+ if ( method_exists( 'DifferenceEngine', 'setTextLanguage' ) ) {
 385+ $diff->setTextLanguage( $wgContLang );
386386 }
387387 $diff->setText( $s->getOldText(), $s->getText() );
388388 $text = $diff->getDiff( wfMsgHtml( 'tpt-diff-old' ), wfMsgHtml( 'tpt-diff-new' ) );
@@ -394,7 +394,7 @@
395395 $text = TranslateUtils::convertWhiteSpaceToHTML( $s->getText() );
396396 }
397397
398 - # For changed text, the language is set by $diff->setDiffLang()
 398+ # For changed text, the language is set by $diff->setTextLanguage()
399399 $lang = $s->type === 'changed' ? null : $wgContLang;
400400 $wgOut->addHTML( MessageWebImporter::makeSectionElement( $name, $s->type, $text, $lang ) );
401401 }
@@ -420,8 +420,8 @@
421421 $wgOut->wrapWikiMsg( '==$1==', 'tpt-sections-template' );
422422
423423 $diff = new DifferenceEngine;
424 - if ( method_exists( 'DifferenceEngine', 'setDiffLang' ) ) {
425 - $diff->setDiffLang( $wgContLang );
 424+ if ( method_exists( 'DifferenceEngine', 'setTextLanguage' ) ) {
 425+ $diff->setTextLanguage( $wgContLang );
426426 }
427427 $diff->setText( $oldTemplate, $newTemplate );
428428 $text = $diff->getDiff( wfMsgHtml( 'tpt-diff-old' ), wfMsgHtml( 'tpt-diff-new' ) );
Index: trunk/extensions/Translate/utils/TranslationHelpers.php
@@ -901,8 +901,8 @@
902902 }
903903
904904 $diff = new DifferenceEngine;
905 - if ( method_exists( 'DifferenceEngine', 'setDiffLang' ) ) {
906 - $diff->setDiffLang( $this->group->getSourceLanguage() );
 905+ if ( method_exists( 'DifferenceEngine', 'setTextLanguage' ) ) {
 906+ $diff->setTextLanguage( $this->group->getSourceLanguage() );
907907 }
908908 $diff->setText( $oldtext, $newtext );
909909 $diff->setReducedLineNumbers();
@@ -953,8 +953,8 @@
954954 }
955955
956956 $diff = new DifferenceEngine;
957 - if ( method_exists( 'DifferenceEngine', 'setDiffLang' ) ) {
958 - $diff->setDiffLang( $this->group->getSourceLanguage() );
 957+ if ( method_exists( 'DifferenceEngine', 'setTextLanguage' ) ) {
 958+ $diff->setTextLanguage( $this->group->getSourceLanguage() );
959959 }
960960 $diff->setText( $oldtext, $newtext );
961961 $diff->setReducedLineNumbers();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92956DifferenceEngine: introduce setDiffLang() to change the language in which the...robin19:03, 23 July 2011

Status & tagging log