r37115 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37114‎ | r37115 | r37116 >
Date:15:42, 5 July 2008
Author:nikerabbit
Status:old
Tags:
Comment:
* 2008-07-05:1 fuzzy.php was ignoring the namespace
Modified paths:
  • /trunk/extensions/Translate/README (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/scripts/fuzzy.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/Translate.php
@@ -11,7 +11,7 @@
1212 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1313 */
1414
15 -define( 'TRANSLATE_VERSION', '9 (2008-07-04:2)' );
 15+define( 'TRANSLATE_VERSION', '9 (2008-07-05:1)' );
1616
1717 $wgExtensionCredits['specialpage'][] = array(
1818 'name' => 'Translate',
Index: trunk/extensions/Translate/scripts/fuzzy.php
@@ -82,7 +82,8 @@
8383 $count = count($msgs);
8484 STDOUT( "Found $count pages to update." );
8585
86 - foreach ( $msgs as $title => $text ) {
 86+ foreach ( $msgs as $phpIsStupid ) {
 87+ list( $title, $text ) = $phpIsStupid;
8788 $this->updateMessage( $title, $text );
8889 }
8990
@@ -114,14 +115,15 @@
115116
116117 $rows = $dbr->select(
117118 array( 'page', 'revision', 'text' ),
118 - array( 'page_title', 'old_text', 'old_flags' ),
 119+ array( 'page_title', 'page_namespace', 'old_text', 'old_flags' ),
119120 $conds,
120121 __METHOD__
121122 );
122123
123124 $messagesContents = array();
124125 foreach ( $rows as $row ) {
125 - $messagesContents[$row->page_title] = Revision::getRevisionText( $row );
 126+ $title = Title::makeTitle( $row->page_namespace, $row->page_title );
 127+ $messagesContents[] = array( $title, Revision::getRevisionText( $row ) );
126128 }
127129
128130 $rows->free();
@@ -131,7 +133,7 @@
132134
133135 private function updateMessage( $title, $text ) {
134136 global $wgTitle, $wgArticle, $wgTranslateDocumentationLanguageCode;
135 - $wgTitle = Title::newFromText( "Mediawiki:$title" );
 137+ $wgTitle = $title;
136138
137139 STDOUT( "Updating {$wgTitle->getPrefixedText()}... ", true );
138140 if ( !$wgTitle instanceof Title ) {
Index: trunk/extensions/Translate/README
@@ -34,6 +34,7 @@
3535
3636 == Changes in version 10 ==
3737
 38+* 2008-07-05:1 fuzzy.php was ignoring the namespace
3839 * 2008-07-04:2
3940 - use a existing hook for quick links
4041 - possible fix for Windows

Status & tagging log