diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2008-08-15 01:29:47 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2008-08-15 01:29:47 +0200 |
commit | 370e83bb0dfd0c70de268c93bf07ad5ee0897192 (patch) | |
tree | 491674f4c242e4d6ba0d04eafa305174c35a3391 /maintenance/language/rebuildLanguage.php | |
parent | f4debf0f12d0524d2b2427c55ea3f16b680fad97 (diff) |
Update auf 1.13.0
Diffstat (limited to 'maintenance/language/rebuildLanguage.php')
-rw-r--r-- | maintenance/language/rebuildLanguage.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/maintenance/language/rebuildLanguage.php b/maintenance/language/rebuildLanguage.php index 6c2076eb..91fda3f4 100644 --- a/maintenance/language/rebuildLanguage.php +++ b/maintenance/language/rebuildLanguage.php @@ -1,8 +1,10 @@ <?php /** - * Rewrite the messages array in the files languages/messages/MessagesXX.php. + * Rewrite the messages array in the files languages/messages/MessagesXx.php. * - * @addtogroup Maintenance + * @file + * @ingroup MaintenanceLanguage + * @defgroup MaintenanceLanguage MaintenanceLanguage */ require_once( dirname(__FILE__).'/../commandLine.inc' ); @@ -15,12 +17,13 @@ require_once( 'writeMessagesArray.inc' ); * @param $code The language code. * @param $write Write to the messages file? * @param $listUnknown List the unknown messages? + * @param $removeUnKnown Remove the unknown messages? */ -function rebuildLanguage( $code, $write, $listUnknown ) { +function rebuildLanguage( $code, $write, $listUnknown, $removeUnknown ) { global $wgLanguages; $messages = $wgLanguages->getMessages( $code ); $messages = $messages['all']; - MessageWriter::writeMessagesToFile( $messages, $code, $write, $listUnknown ); + MessageWriter::writeMessagesToFile( $messages, $code, $write, $listUnknown, $removeUnknown ); } # Show help @@ -31,8 +34,9 @@ Parameters: * lang: Language code (default: the installation default language). You can also specify "all" to check all the languages. * help: Show this help. Options: - * dry-run: Don't write the array to the file. - * no-unknown: Don't list the unknown messages. + * dry-run: Do not write the array to the file. + * no-unknown: Do not list the unknown messages. + * remove-unknown: Remove unknown messages. END; exit(); @@ -48,6 +52,7 @@ if ( isset( $options['lang'] ) ) { # Get the options $wgWriteToFile = !isset( $options['dry-run'] ); $wgListUnknownMessages = !isset( $options['no-unknown'] ); +$wgRemoveUnknownMessages = isset( $options['remove-unknown'] ); # Get language objects $wgLanguages = new languages(); @@ -55,10 +60,8 @@ $wgLanguages = new languages(); # Write all the language if ( $wgCode == 'all' ) { foreach ( $wgLanguages->getLanguages() as $language ) { - rebuildLanguage( $language, $wgWriteToFile, $wgListUnknownMessages ); + rebuildLanguage( $language, $wgWriteToFile, $wgListUnknownMessages, $wgRemoveUnknownMessages ); } } else { - rebuildLanguage( $wgCode, $wgWriteToFile, $wgListUnknownMessages ); + rebuildLanguage( $wgCode, $wgWriteToFile, $wgListUnknownMessages, $wgRemoveUnknownMessages ); } - - |