* Be more robust and do the right thing automatically (with small speed penalty)...
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Wed, 24 Oct 2007 17:43:27 +0000 (17:43 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Wed, 24 Oct 2007 17:43:27 +0000 (17:43 +0000)
maintenance/language/messages.inc
maintenance/language/writeMessagesArray.inc

index cdf56d7..345d345 100644 (file)
@@ -2410,11 +2410,3 @@ $wgMessageComments = array(
        'exif-orientation-8'          => '0th row: left; 0th column: bottom',
        'movepage-moved'              => 'The two titles are passed in plain text as $3 and $4 to allow additional goodies in the message.'
 );
-
-/** Messages which contain dollar signs (which are not followed by numbers), and therefore should use a single apostrophe */
-$wgMessagseWithDollarSigns = array(
-       'linkprefix',
-       'enotif_subject',
-       'enotif_body',
-       'allmessagesnotsupportedDB',
-);
index bcbf05e..e40ad52 100644 (file)
@@ -103,8 +103,7 @@ function writeMessagesArray( $messages, $ignoredComments = false ) {
  * @return The block, formatted in PHP.
  */
 function writeMessagesBlock( $name, $comment, $messages, $ignoredComments ) {
-       global $wgMessageComments, $wgMessagseWithDollarSigns;
-       global $wgIgnoredMessages, $wgOptionalMessages;
+       global $wgMessageComments, $wgIgnoredMessages, $wgOptionalMessages;
        $blockText = '';
 
        # Skip the block if it includes no messages
@@ -142,7 +141,7 @@ $comment
                # Check for the appropriate apostrophe and add the value
                if ( strpos( $value, "'" ) === false ) {
                        $blockText .= "'$value'";
-               } elseif ( strpos( $value, '"' ) === false && !in_array( $key, $wgMessagseWithDollarSigns ) ) {
+               } elseif ( strpos( $value, '"' ) === false && !preg_match('/\$[a-zA-Z]/', $value) ) {
                        $blockText .= "\"$value\"";
                } else {
                        # Pick the less numerous one to escape