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 * @subpackage Maintenance
17 function check($arrayname) {
18 $arraynameprinted = 0;
20 global $count, $total, $wgLanguageCode;
22 $msgarray = $arrayname . ucfirst( $wgLanguageCode );
23 $msgarrayen = $arrayname . "En";
28 foreach ( $
$msgarrayen as $code => $msg ) {
31 if ( ! array_key_exists( $code, $
$msgarray ) ) {
32 if (!$arraynameprinted) {
33 print("\nIn array '$msgarray':\n");
34 $arraynameprinted = 1;
43 if ( ! is_readable( "../LocalSettings.php" ) ) {
44 print "A copy of your installation's LocalSettings.php\n" .
45 "must exist in the source directory.\n";
50 require_once( "../LocalSettings.php" );
52 if ( "en" == $wgLanguageCode ) {
53 print "Current selected language is English. Cannot check translations.\n";
56 $include = "Language" . ucfirst( $wgLanguageCode ) . ".php";
57 if ( ! is_readable( "{$IP}/{$include}" ) ) {
58 print "Translation file \"{$include}\" not found in installation directory.\n" .
59 "You must have the software installed to run this script.\n";
66 require_once( "{$IP}/Setup.php" );
67 $wgTitle = Title
::newFromText( "Translation checking script" );
68 $wgCommandLineMode = true;
73 check("wgLanguageNames");
74 check("wgNamespaceNames");
75 check("wgDefaultUserOptions");
76 check("wgQuickbarSettings");
79 check("wgUserToggles");
80 check("wgWeekdayNames");
81 check("wgMonthNames");
82 check("wgMonthAbbreviations");
83 check("wgValidSpecialPages");
84 check("wgSysopSpecialPages");
85 check("wgDeveloperSpecialPages");
86 check("wgAllMessages");
88 print "{$count} messages of {$total} not translated.\n";