From e3c35ec473256006f1abd8301845e8e925d501fc Mon Sep 17 00:00:00 2001 From: Shinjiman Date: Sat, 23 May 2009 10:06:10 +0000 Subject: [PATCH] added support to output as PHP syntax --- maintenance/language/checkDupeMessages.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/maintenance/language/checkDupeMessages.php b/maintenance/language/checkDupeMessages.php index a4898afa26..b5ea54f365 100644 --- a/maintenance/language/checkDupeMessages.php +++ b/maintenance/language/checkDupeMessages.php @@ -18,6 +18,8 @@ if ( isset( $options['lang'] ) && isset( $options['clang'] )) { } else { if (!strcmp($options['mode'],'wiki')) { $runMode = 'wiki'; + } else if (!strcmp($options['mode'],'php')) { + $runMode = 'php'; } else if (!strcmp($options['mode'],'raw')) { $runMode = 'raw'; } else { @@ -34,6 +36,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 * raw: Raw output for duplicates END; } @@ -67,12 +70,18 @@ if ( $run ) { $wgMessages[$langCodeC] = $messages; $count = 0; + if (!strcmp($runMode,'php')) { + print(" $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"); + } else if (!strcmp($runMode,'php')) { + print("'$key' => '',\n"); } else if (!strcmp($runMode,'wiki')) { $uKey = ucfirst($key); print("* MediaWiki:$uKey/$langCode\n"); @@ -84,6 +93,9 @@ if ( $run ) { } } } + if (!strcmp($runMode,'php')) { + print(");\n"); + } if (!strcmp($runMode,'text')) { if ($count == 1) { echo "\nThere are $count duplicated message in $langCode, against to $langCodeC.\n"; -- 2.20.1