Index: trunk/phase3/maintenance/language/checkDupeMessages.php |
— | — | @@ -65,42 +65,54 @@ |
66 | 66 | $runMode = 'raw'; |
67 | 67 | } |
68 | 68 | include( $messagesFile ); |
69 | | - $wgMessages[$langCode] = $messages; |
| 69 | + $messageExist = isset($messages); |
| 70 | + if ($messageExist) |
| 71 | + $wgMessages[$langCode] = $messages; |
70 | 72 | include( $messagesFileC ); |
71 | | - $wgMessages[$langCodeC] = $messages; |
| 73 | + $messageCExist = isset($messages); |
| 74 | + if ($messageCExist) |
| 75 | + $wgMessages[$langCodeC] = $messages; |
72 | 76 | $count = 0; |
73 | 77 | |
74 | | - if (!strcmp($runMode,'php')) { |
75 | | - print("<?php\n"); |
76 | | - print('$dupeMessages = array('."\n"); |
77 | | - } |
78 | | - foreach ($wgMessages[$langCodeC] as $key => $value) { |
79 | | - foreach ($wgMessages[$langCode] as $ckey => $cvalue) { |
80 | | - if (!strcmp($key,$ckey)) { |
81 | | - if ((!strcmp($key,$ckey)) && (!strcmp($value,$cvalue))) { |
82 | | - if (!strcmp($runMode,'raw')) { |
83 | | - print("$key\n"); |
84 | | - } else if (!strcmp($runMode,'php')) { |
85 | | - print("'$key' => '',\n"); |
86 | | - } else if (!strcmp($runMode,'wiki')) { |
87 | | - $uKey = ucfirst($key); |
88 | | - print("* MediaWiki:$uKey/$langCode\n"); |
89 | | - } else { |
90 | | - print("* $key\n"); |
| 78 | + if (($messageExist) && ($messageCExist)) { |
| 79 | + |
| 80 | + if (!strcmp($runMode,'php')) { |
| 81 | + print("<?php\n"); |
| 82 | + print('$dupeMessages = array('."\n"); |
| 83 | + } |
| 84 | + foreach ($wgMessages[$langCodeC] as $key => $value) { |
| 85 | + foreach ($wgMessages[$langCode] as $ckey => $cvalue) { |
| 86 | + if (!strcmp($key,$ckey)) { |
| 87 | + if ((!strcmp($key,$ckey)) && (!strcmp($value,$cvalue))) { |
| 88 | + if (!strcmp($runMode,'raw')) { |
| 89 | + print("$key\n"); |
| 90 | + } else if (!strcmp($runMode,'php')) { |
| 91 | + print("'$key' => '',\n"); |
| 92 | + } else if (!strcmp($runMode,'wiki')) { |
| 93 | + $uKey = ucfirst($key); |
| 94 | + print("* MediaWiki:$uKey/$langCode\n"); |
| 95 | + } else { |
| 96 | + print("* $key\n"); |
| 97 | + } |
| 98 | + $count++; |
91 | 99 | } |
92 | | - $count++; |
93 | 100 | } |
94 | 101 | } |
95 | 102 | } |
96 | | - } |
97 | | - if (!strcmp($runMode,'php')) { |
98 | | - print(");\n"); |
99 | | - } |
100 | | - if (!strcmp($runMode,'text')) { |
101 | | - if ($count == 1) { |
102 | | - echo "\nThere are $count duplicated message in $langCode, against to $langCodeC.\n"; |
103 | | - } else { |
104 | | - echo "\nThere are $count duplicated messages in $langCode, against to $langCodeC.\n"; |
| 103 | + if (!strcmp($runMode,'php')) { |
| 104 | + print(");\n"); |
105 | 105 | } |
| 106 | + if (!strcmp($runMode,'text')) { |
| 107 | + if ($count == 1) { |
| 108 | + echo "\nThere are $count duplicated message in $langCode, against to $langCodeC.\n"; |
| 109 | + } else { |
| 110 | + echo "\nThere are $count duplicated messages in $langCode, against to $langCodeC.\n"; |
| 111 | + } |
| 112 | + } |
| 113 | + } else { |
| 114 | + if (!$messageExist) |
| 115 | + echo "There are no messages defined in $langCode.\n"; |
| 116 | + if (!$messageCExist) |
| 117 | + echo "There are no messages defined in $langCodeC.\n"; |
106 | 118 | } |
107 | 119 | } |