diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2006-10-11 20:21:25 +0000 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2006-10-11 20:21:25 +0000 |
commit | d81f562b712f2387fa02290bf2ca86392ab356f2 (patch) | |
tree | d666cdefbe6ac320827a2c6cb473581b46e22c4c /maintenance/language/checktrans.php | |
parent | 183851b06bd6c52f3cae5375f433da720d410447 (diff) |
Aktualisierung auf Version 1.8.1
Diffstat (limited to 'maintenance/language/checktrans.php')
-rw-r--r-- | maintenance/language/checktrans.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/maintenance/language/checktrans.php b/maintenance/language/checktrans.php new file mode 100644 index 00000000..a5772d47 --- /dev/null +++ b/maintenance/language/checktrans.php @@ -0,0 +1,44 @@ +<?php +/** + * @package MediaWiki + * @subpackage Maintenance + * Check to see if all messages have been translated into the selected language. + * To run this script, you must have a working installation, and you can specify + * a language, or the script will check the installation language. + */ + +/** */ +require_once(dirname(__FILE__).'/../commandLine.inc'); + +if ( isset( $args[0] ) ) { + $code = $args[0]; +} else { + $code = $wgLang->getCode(); +} + +if ( $code == 'en' ) { + print "Current selected language is English. Cannot check translations.\n"; + exit(); +} + +$filename = Language::getMessagesFileName( $code ); +if ( file_exists( $filename ) ) { + require( $filename ); +} else { + $messages = array(); +} + +$count = $total = 0; +$wgEnglishMessages = Language::getMessagesFor( 'en' ); +$wgLocalMessages = $messages; + +foreach ( $wgEnglishMessages as $key => $msg ) { + ++$total; + if ( !isset( $wgLocalMessages[$key] ) ) { + print "'{$key}' => \"$msg\",\n"; + ++$count; + } +} + +print "{$count} messages of {$total} are not translated in the language {$code}.\n"; +?> |