summaryrefslogtreecommitdiff
path: root/maintenance/language/checkDupeMessages.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-12-08 09:55:49 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-12-08 09:55:49 +0100
commit4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch)
treeaf68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /maintenance/language/checkDupeMessages.php
parentaf4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff)
Update to MediaWiki 1.22.0
Diffstat (limited to 'maintenance/language/checkDupeMessages.php')
-rw-r--r--maintenance/language/checkDupeMessages.php34
1 files changed, 19 insertions, 15 deletions
diff --git a/maintenance/language/checkDupeMessages.php b/maintenance/language/checkDupeMessages.php
index 6abf7b44..381ddae1 100644
--- a/maintenance/language/checkDupeMessages.php
+++ b/maintenance/language/checkDupeMessages.php
@@ -21,7 +21,7 @@
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../commandLine.inc' );
+require_once __DIR__ . '/../commandLine.inc';
$messagesDir = __DIR__ . '/../../languages/messages/';
$runTest = false;
$run = false;
@@ -52,7 +52,7 @@ Options:
* mode: Output format, can be either:
* text: Text output on the console (default)
* wiki: Wiki format, with * at beginning of each line
- * php: Output text as PHP syntax in a array $dupeMessages
+ * php: Output text as PHP syntax in an array named \$dupeMessages
* raw: Raw output for duplicates
TEXT;
}
@@ -80,35 +80,37 @@ if ( $run ) {
} elseif ( !strcmp( $runMode, 'raw' ) ) {
$runMode = 'raw';
}
- include( $messagesFile );
+ include $messagesFile;
$messageExist = isset( $messages );
- if ( $messageExist )
+ if ( $messageExist ) {
$wgMessages[$langCode] = $messages;
- include( $messagesFileC );
+ }
+ include $messagesFileC;
$messageCExist = isset( $messages );
- if ( $messageCExist )
+ if ( $messageCExist ) {
$wgMessages[$langCodeC] = $messages;
+ }
$count = 0;
if ( ( $messageExist ) && ( $messageCExist ) ) {
if ( !strcmp( $runMode, 'php' ) ) {
- print( "<?php\n" );
- print( '$dupeMessages = array(' . "\n" );
+ print "<?php\n";
+ print '$dupeMessages = array(' . "\n";
}
foreach ( $wgMessages[$langCodeC] as $key => $value ) {
foreach ( $wgMessages[$langCode] as $ckey => $cvalue ) {
if ( !strcmp( $key, $ckey ) ) {
if ( ( !strcmp( $key, $ckey ) ) && ( !strcmp( $value, $cvalue ) ) ) {
if ( !strcmp( $runMode, 'raw' ) ) {
- print( "$key\n" );
+ print "$key\n";
} elseif ( !strcmp( $runMode, 'php' ) ) {
- print( "'$key' => '',\n" );
+ print "'$key' => '',\n";
} elseif ( !strcmp( $runMode, 'wiki' ) ) {
$uKey = ucfirst( $key );
- print( "* MediaWiki:$uKey/$langCode\n" );
+ print "* MediaWiki:$uKey/$langCode\n";
} else {
- print( "* $key\n" );
+ print "* $key\n";
}
$count++;
}
@@ -116,7 +118,7 @@ if ( $run ) {
}
}
if ( !strcmp( $runMode, 'php' ) ) {
- print( ");\n" );
+ print ");\n";
}
if ( !strcmp( $runMode, 'text' ) ) {
if ( $count == 1 ) {
@@ -126,9 +128,11 @@ if ( $run ) {
}
}
} else {
- if ( !$messageExist )
+ if ( !$messageExist ) {
echo "There are no messages defined in $langCode.\n";
- if ( !$messageCExist )
+ }
+ if ( !$messageCExist ) {
echo "There are no messages defined in $langCodeC.\n";
+ }
}
}