r19035 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19034‎ | r19035 | r19036 >
Date:21:13, 9 January 2007
Author:hashar
Status:old
Tags:
Comment:
Update script with changes made in language.inc. Stuff still generated in /locale/
Modified paths:
  • /trunk/phase3/maintenance/language/lang2po.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/lang2po.php
@@ -69,7 +69,7 @@
7070 * @param array &$messages Array containing the various messages.
7171 * @return string Filename where stuff got saved or false.
7272 */
73 -function generatePo($langcode, &$messages) {
 73+function generatePo($langcode, $messages) {
7474 $data = poHeader();
7575
7676 // Generate .po entries
@@ -135,20 +135,13 @@
136136 $langTool = new languages();
137137
138138 // 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";
145143 } 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);
153146 }
154147 }
155148 ?>