Index: trunk/phase3/maintenance/language/lang2po.php |
— | — | @@ -69,7 +69,7 @@ |
70 | 70 | * @param array &$messages Array containing the various messages. |
71 | 71 | * @return string Filename where stuff got saved or false. |
72 | 72 | */ |
73 | | -function generatePo($langcode, &$messages) { |
| 73 | +function generatePo($langcode, $messages) { |
74 | 74 | $data = poHeader(); |
75 | 75 | |
76 | 76 | // Generate .po entries |
— | — | @@ -135,20 +135,13 @@ |
136 | 136 | $langTool = new languages(); |
137 | 137 | |
138 | 138 | // Do all languages |
139 | | -foreach ( $langTool->getMessages() as $langcode) { |
140 | | - echo "Loading messages for $langcode:\t"; |
141 | | - require_once( Language::getClassFileName( $langcode ) ); |
142 | | - $arr = 'wgAllMessages'.$langcode; |
143 | | - if(!@is_array($$arr)) { |
144 | | - echo "NONE FOUND\n"; |
| 139 | +foreach ( $langTool->getLanguages() as $langcode) { |
| 140 | + echo "Loading messages for $langcode:\n"; |
| 141 | + if( ! generatePo($langcode, $langTool->getMessages($langcode) ) ) { |
| 142 | + echo "ERROR: Failed to wrote file.\n"; |
145 | 143 | } else { |
146 | | - echo "ok\n"; |
147 | | - if( ! generatePo($langcode, $$arr) ) { |
148 | | - echo "ERROR: Failed to wrote file.\n"; |
149 | | - } else { |
150 | | - echo "Applying template:"; |
151 | | - applyPot($langcode); |
152 | | - } |
| 144 | + echo "Applying template:"; |
| 145 | + applyPot($langcode); |
153 | 146 | } |
154 | 147 | } |
155 | 148 | ?> |