patch to remove lcc_title column from linkscc table for 1.3
[lhc/web/wiklou.git] / maintenance / checktrans-enhanced.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 # The enhanced version will check more arrays than just
9 # wgAllMessages
10
11
12
13 function check($arrayname)
14 {
15 $arraynameprinted = 0;
16
17 global $count, $total, $wgLanguageCode;
18
19 $msgarray = $arrayname . ucfirst( $wgLanguageCode );
20 $msgarrayen = $arrayname . "En";
21
22 global $$msgarray;
23 global $$msgarrayen;
24
25 foreach ( $$msgarrayen as $code => $msg ) {
26 ++$total;
27
28 if ( ! array_key_exists( $code, $$msgarray ) ) {
29 if (!$arraynameprinted) {
30 print("\nIn array '$msgarray':\n");
31 $arraynameprinted = 1;
32 }
33
34 print "{$code}\n";
35 ++$count;
36 }
37 }
38 }
39
40
41
42
43
44
45 if ( ! is_readable( "../LocalSettings.php" ) ) {
46 print "A copy of your installation's LocalSettings.php\n" .
47 "must exist in the source directory.\n";
48 exit();
49 }
50
51 $DP = "../includes";
52 require_once( "../LocalSettings.php" );
53
54 if ( "en" == $wgLanguageCode ) {
55 print "Current selected language is English. Cannot check translations.\n";
56 exit();
57 }
58 $include = "Language" . ucfirst( $wgLanguageCode ) . ".php";
59 if ( ! is_readable( "{$IP}/{$include}" ) ) {
60 print "Translation file \"{$include}\" not found in installation directory.\n" .
61 "You must have the software installed to run this script.\n";
62 exit();
63 }
64
65 umask( 000 );
66 set_time_limit( 0 );
67
68 require_once( "{$IP}/Setup.php" );
69 $wgTitle = Title::newFromText( "Translation checking script" );
70 $wgCommandLineMode = true;
71
72 $count = $total = 0;
73
74
75
76
77
78
79
80 check("wgLanguageNames");
81 check("wgNamespaceNames");
82 check("wgDefaultUserOptions");
83 check("wgQuickbarSettings");
84 check("wgSkinNames");
85 check("wgMathNames");
86 check("wgUserToggles");
87 check("wgWeekdayNames");
88 check("wgMonthNames");
89 check("wgMonthAbbreviations");
90 check("wgValidSpecialPages");
91 check("wgSysopSpecialPages");
92 check("wgDeveloperSpecialPages");
93 check("wgAllMessages");
94
95 print "{$count} messages of {$total} not translated.\n";
96