Phpdoc comments and place holder. Part of the subpackage "maintenance", archives...
[lhc/web/wiklou.git] / maintenance / checktrans.php
1 <?php
2 /**
3 * Check to see if all messages have been translated into
4 * the selected language. To run this script, you must have
5 * a working installation, and it checks the selected language
6 * of that installation.
7 *
8 * @package MediaWiki
9 * @subpackage Maintenance
10 */
11
12 /** */
13 if ( ! is_readable( "../LocalSettings.php" ) ) {
14 print "A copy of your installation's LocalSettings.php\n" .
15 "must exist in the source directory.\n";
16 exit();
17 }
18
19 $wgCommandLineMode = true;
20 $DP = "../includes";
21 require_once( "../LocalSettings.php" );
22
23 if ( "en" == $wgLanguageCode ) {
24 print "Current selected language is English. Cannot check translations.\n";
25 exit();
26 }
27 $include = "Language" . ucfirst( $wgLanguageCode ) . ".php";
28 if ( ! is_readable( "{$IP}/{$include}" ) ) {
29 print "Translation file \"{$include}\" not found in installation directory.\n" .
30 "You must have the software installed to run this script.\n";
31 exit();
32 }
33
34 umask( 000 );
35 set_time_limit( 0 );
36
37 require_once( "{$IP}/Setup.php" );
38 $wgTitle = Title::newFromText( "Translation checking script" );
39
40 $count = $total = 0;
41 $msgarray = "wgAllMessages" . ucfirst( $wgLanguageCode );
42
43 foreach ( $wgAllMessagesEn as $code => $msg ) {
44 ++$total;
45
46 if ( ! array_key_exists( $code, $$msgarray ) ) {
47 print "{$code}\n";
48 ++$count;
49 }
50 }
51 print "{$count} messages of {$total} not translated.\n";