diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2008-03-21 11:49:34 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2008-03-21 11:49:34 +0100 |
commit | 086ae52d12011746a75f5588e877347bc0457352 (patch) | |
tree | e73263c7a29d0f94fafb874562610e16eb292ba8 /maintenance/language/lang2po.php | |
parent | 749e7fb2bae7bbda855de3c9e319435b9f698ff7 (diff) |
Update auf MediaWiki 1.12.0
Diffstat (limited to 'maintenance/language/lang2po.php')
-rw-r--r-- | maintenance/language/lang2po.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/maintenance/language/lang2po.php b/maintenance/language/lang2po.php index 0ea3faaa..a5aa81aa 100644 --- a/maintenance/language/lang2po.php +++ b/maintenance/language/lang2po.php @@ -7,6 +7,8 @@ * - fix escaping of \ */ +$optionsWithArgs[] = 'lang'; + /** This is a command line script */ require_once(dirname(__FILE__).'/../commandLine.inc'); require_once(dirname(__FILE__).'/languages.inc'); @@ -73,7 +75,7 @@ function generatePo($langcode, $messages) { $data = poHeader(); // Generate .po entries - foreach($messages as $identifier => $content) { + foreach($messages['all'] as $identifier => $content) { $data .= "msgid \"$identifier\"\n"; // Escape backslashes @@ -134,11 +136,17 @@ echo "done.\n"; $langTool = new languages(); +if( $options['lang'] === ALL_LANGUAGES ) { + $codes = $langTool->getLanguages(); +} else { + $codes = array( $options['lang'] ); +} + // Do all languages -foreach ( $langTool->getLanguages() as $langcode) { +foreach ( $codes as $langcode) { echo "Loading messages for $langcode:\n"; if( ! generatePo($langcode, $langTool->getMessages($langcode) ) ) { - echo "ERROR: Failed to wrote file.\n"; + echo "ERROR: Failed to write file.\n"; } else { echo "Applying template:"; applyPot($langcode); |