Index: trunk/phase3/maintenance/language/checkDupeMessages.php |
— | — | @@ -18,6 +18,8 @@ |
19 | 19 | } else { |
20 | 20 | if (!strcmp($options['mode'],'wiki')) { |
21 | 21 | $runMode = 'wiki'; |
| 22 | + } else if (!strcmp($options['mode'],'php')) { |
| 23 | + $runMode = 'php'; |
22 | 24 | } else if (!strcmp($options['mode'],'raw')) { |
23 | 25 | $runMode = 'raw'; |
24 | 26 | } else { |
— | — | @@ -34,6 +36,7 @@ |
35 | 37 | * mode: Output format, can be either: |
36 | 38 | * text: Text output on the console (default) |
37 | 39 | * wiki: Wiki format, with * at beginning of each line |
| 40 | + * php: Output text as PHP syntax in a array $dupeMessages |
38 | 41 | * raw: Raw output for duplicates |
39 | 42 | END; |
40 | 43 | } |
— | — | @@ -67,12 +70,18 @@ |
68 | 71 | $wgMessages[$langCodeC] = $messages; |
69 | 72 | $count = 0; |
70 | 73 | |
| 74 | + if (!strcmp($runMode,'php')) { |
| 75 | + print("<?php\n"); |
| 76 | + print('$dupeMessages = array('."\n"); |
| 77 | + } |
71 | 78 | foreach ($wgMessages[$langCodeC] as $key => $value) { |
72 | 79 | foreach ($wgMessages[$langCode] as $ckey => $cvalue) { |
73 | 80 | if (!strcmp($key,$ckey)) { |
74 | 81 | if ((!strcmp($key,$ckey)) && (!strcmp($value,$cvalue))) { |
75 | 82 | if (!strcmp($runMode,'raw')) { |
76 | 83 | print("$key\n"); |
| 84 | + } else if (!strcmp($runMode,'php')) { |
| 85 | + print("'$key' => '',\n"); |
77 | 86 | } else if (!strcmp($runMode,'wiki')) { |
78 | 87 | $uKey = ucfirst($key); |
79 | 88 | print("* MediaWiki:$uKey/$langCode\n"); |
— | — | @@ -84,6 +93,9 @@ |
85 | 94 | } |
86 | 95 | } |
87 | 96 | } |
| 97 | + if (!strcmp($runMode,'php')) { |
| 98 | + print(");\n"); |
| 99 | + } |
88 | 100 | if (!strcmp($runMode,'text')) { |
89 | 101 | if ($count == 1) { |
90 | 102 | echo "\nThere are $count duplicated message in $langCode, against to $langCodeC.\n"; |