Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

checktrans.php

Go to the documentation of this file.
00001 <?php 00002 00003 # Check to see if all messages have been translated into 00004 # the selected language. To run this script, you must have 00005 # a working installation, and it checks the selected language 00006 # of that installation. 00007 # 00008 00009 if ( ! is_readable( "../LocalSettings.php" ) ) { 00010 print "A copy of your installation's LocalSettings.php\n" . 00011 "must exist in the source directory.\n"; 00012 exit(); 00013 } 00014 00015 $wgCommandLineMode = true; 00016 $DP = "../includes"; 00017 require_once( "../LocalSettings.php" ); 00018 00019 if ( "en" == $wgLanguageCode ) { 00020 print "Current selected language is English. Cannot check translations.\n"; 00021 exit(); 00022 } 00023 $include = "Language" . ucfirst( $wgLanguageCode ) . ".php"; 00024 if ( ! is_readable( "{$IP}/{$include}" ) ) { 00025 print "Translation file \"{$include}\" not found in installation directory.\n" . 00026 "You must have the software installed to run this script.\n"; 00027 exit(); 00028 } 00029 00030 umask( 000 ); 00031 set_time_limit( 0 ); 00032 00033 require_once( "{$IP}/Setup.php" ); 00034 $wgTitle = Title::newFromText( "Translation checking script" ); 00035 00036 $count = $total = 0; 00037 $msgarray = "wgAllMessages" . ucfirst( $wgLanguageCode ); 00038 00039 foreach ( $wgAllMessagesEn as $code => $msg ) { 00040 ++$total; 00041 00042 if ( ! array_key_exists( $code, $$msgarray ) ) { 00043 print "{$code}\n"; 00044 ++$count; 00045 } 00046 } 00047 print "{$count} messages of {$total} not translated.\n"; 00048

Generated on Tue Jun 29 23:40:03 2004 for Mediawiki by doxygen 1.3.7