r24423 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24422‎ | r24423 | r24424 >
Date:02:04, 29 July 2007
Author:rotem
Status:old
Tags:
Comment:
Use native newlines when rebuilding a messages file.
Modified paths:
  • /trunk/phase3/maintenance/language/writeMessagesArray.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/writeMessagesArray.inc
@@ -1,8 +1,6 @@
22 <?php
33 /**
44 * Write a messages array as a PHP text.
5 - * TODO: make it possible to use Windows endlines
6 - * TODO: remove PHP ending tags recently removed from MediaWiki files
75 *
86 * @addtogroup Maintenance
97 */
@@ -75,7 +73,8 @@
7674 }
7775
7876 # Write all the messages
79 - $messagesText = "\$messages = array(\n";
 77+ $messagesText = "\$messages = array(
 78+";
8079 foreach( $sortedMessages as $block => $messages ) {
8180 # Skip if it's the block of unknown messages - handle that in the end of file
8281 if ( $block == 'unknown' ) {
@@ -87,7 +86,8 @@
8887 }
8988 ksort( $sortedMessages['unknown'] );
9089 $messagesText .= writeMessagesBlock( 'unknown', 'Unknown messages', $sortedMessages['unknown'], $ignoredComments ); # Write the unknown messages, alphabetically sorted
91 - $messagesText .= ");\n";
 90+ $messagesText .= ");
 91+";
9292
9393 return array( $messagesText, $sortedMessages );
9494 }
@@ -115,9 +115,13 @@
116116 # Format the block comment (if exists); check for multiple lines comments
117117 if ( !empty( $comment ) ) {
118118 if ( strpos( $comment, "\n" ) === false ) {
119 - $blockText .= "# $comment\n";
 119+ $blockText .= "# $comment
 120+";
120121 } else {
121 - $blockText .= "/*\n$comment\n*/\n";
 122+ $blockText .= "/*
 123+$comment
 124+*/
 125+";
122126 }
123127 }
124128
@@ -173,11 +177,13 @@
174178 }
175179
176180 # Newline
177 - $blockText .= "\n";
 181+ $blockText .= "
 182+";
178183 }
179184
180185 # Newline to end the block
181 - $blockText .= "\n";
 186+ $blockText .= "
 187+";
182188
183189 return $blockText;
184190 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r24469Update for r24423 by Rotemraymond16:23, 30 July 2007
r24502Merged revisions 24415-24479 via svnmerge from...david22:31, 31 July 2007

Status & tagging log