Index: trunk/phase3/maintenance/language/lang2po.php |
— | — | @@ -7,6 +7,8 @@ |
8 | 8 | * - fix escaping of \ |
9 | 9 | */ |
10 | 10 | |
| 11 | +$optionsWithArgs[] = 'lang'; |
| 12 | + |
11 | 13 | /** This is a command line script */ |
12 | 14 | require_once(dirname(__FILE__).'/../commandLine.inc'); |
13 | 15 | require_once(dirname(__FILE__).'/languages.inc'); |
— | — | @@ -73,7 +75,7 @@ |
74 | 76 | $data = poHeader(); |
75 | 77 | |
76 | 78 | // Generate .po entries |
77 | | - foreach($messages as $identifier => $content) { |
| 79 | + foreach($messages['all'] as $identifier => $content) { |
78 | 80 | $data .= "msgid \"$identifier\"\n"; |
79 | 81 | |
80 | 82 | // Escape backslashes |
— | — | @@ -134,8 +136,14 @@ |
135 | 137 | |
136 | 138 | $langTool = new languages(); |
137 | 139 | |
| 140 | +if( $options['lang'] === ALL_LANGUAGES ) { |
| 141 | + $codes = $langTool->getLanguages(); |
| 142 | +} else { |
| 143 | + $codes = array( $options['lang'] ); |
| 144 | +} |
| 145 | + |
138 | 146 | // Do all languages |
139 | | -foreach ( $langTool->getLanguages() as $langcode) { |
| 147 | +foreach ( $codes as $langcode) { |
140 | 148 | echo "Loading messages for $langcode:\n"; |
141 | 149 | if( ! generatePo($langcode, $langTool->getMessages($langcode) ) ) { |
142 | 150 | echo "ERROR: Failed to write file.\n"; |