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.
8 # The enhanced version will check more arrays than just
13 function check($arrayname)
15 $arraynameprinted = 0;
17 global $count, $total, $wgLanguageCode;
19 $msgarray = $arrayname . ucfirst( $wgLanguageCode );
20 $msgarrayen = $arrayname . "En";
25 foreach ( $
$msgarrayen as $code => $msg ) {
28 if ( ! array_key_exists( $code, $
$msgarray ) ) {
29 if (!$arraynameprinted) {
30 print("\nIn array '$msgarray':\n");
31 $arraynameprinted = 1;
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";
52 include_once( "../LocalSettings.php" );
54 if ( "en" == $wgLanguageCode ) {
55 print "Current selected language is English. Cannot check translations.\n";
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";
68 include_once( "{$IP}/Setup.php" );
69 $wgTitle = Title
::newFromText( "Translation checking script" );
70 $wgCommandLineMode = true;
80 check("wgLanguageNames");
81 check("wgNamespaceNames");
82 check("wgDefaultUserOptions");
83 check("wgQuickbarSettings");
86 check("wgUserToggles");
87 check("wgWeekdayNames");
88 check("wgMonthNames");
89 check("wgMonthAbbreviations");
90 check("wgValidSpecialPages");
91 check("wgSysopSpecialPages");
92 check("wgDeveloperSpecialPages");
93 check("wgAllMessages");
95 print "{$count} messages of {$total} not translated.\n";