thumb updates
[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
9 if ( ! is_readable( "../LocalSettings.php" ) ) {
10 print "A copy of your installation's LocalSettings.php\n" .
11 "must exist in the source directory.\n";
12 exit();
13 }
14
15 $wgCommandLineMode = true;
16 $DP = "../includes";
17 require_once( "../LocalSettings.php" );
18
19 if ( "en" == $wgLanguageCode ) {
20 print "Current selected language is English. Cannot check translations.\n";
21 exit();
22 }
23 $include = "Language" . ucfirst( $wgLanguageCode ) . ".php";
24 if ( ! is_readable( "{$IP}/{$include}" ) ) {
25 print "Translation file \"{$include}\" not found in installation directory.\n" .
26 "You must have the software installed to run this script.\n";
27 exit();
28 }
29
30 umask( 000 );
31 set_time_limit( 0 );
32
33 require_once( "{$IP}/Setup.php" );
34 $wgTitle = Title::newFromText( "Translation checking script" );
35
36 $count = $total = 0;
37 $msgarray = "wgAllMessages" . ucfirst( $wgLanguageCode );
38
39 foreach ( $wgAllMessagesEn as $code => $msg ) {
40 ++$total;
41
42 if ( ! array_key_exists( $code, $$msgarray ) ) {
43 print "{$code}\n";
44 ++$count;
45 }
46 }
47 print "{$count} messages of {$total} not translated.\n";
48