5 * @subpackage Maintenance
9 die("This script is not being maintained.");
11 # Checks translation of all language files
13 function wfLocalUrl() { return "";}
14 function wfLocalUrle() { return "";}
16 function check($arrayname, $lang, $text)
18 $arraynameprinted = 0;
20 global $count, $total;
22 $msgarray = $arrayname . ucfirst( $lang );
23 $msgarrayen = $arrayname . "En";
26 if ( !is_array( $
$msgarrayen ) ) {
27 print "\nArray '$msgarrayen' not present\n";
29 } elseif ( !is_array( $
$msgarray ) ) {
30 print "\nArray '$msgarray' not present\n";
34 foreach ( $
$msgarrayen as $code => $msg ) {
37 if ( ! array_key_exists( $code, $
$msgarray ) ) {
38 if (!$arraynameprinted) {
39 print("\nIn array '$msgarray':\n");
40 $arraynameprinted = 1;
43 if ( is_numeric( $code ) ) {
44 print "$code ($msg)\n";
53 function getLanguage( $lang )
55 $fileName = "../languages/Language" . ucfirst( $lang ) . ".php";
56 $file = fopen( $fileName, "r" );
57 $text = fread( $file, filesize( $fileName ) );
58 $clipPos = strpos( $text, "class Language" );
59 $text = substr( $text, 0, $clipPos );
60 $text = preg_replace( "/^<\?(php|)/", "", $text );
61 $text = preg_replace( "/^include.*$/m", "", $text );
66 function checkLanguage( $lang, $enText )
68 $text = $enText . getLanguage( $lang );
69 check("wgLanguageNames", $lang, $text);
70 check("wgNamespaceNames", $lang, $text);
71 check("wgDefaultUserOptions", $lang, $text);
72 check("wgQuickbarSettings", $lang, $text);
73 check("wgSkinNames", $lang, $text);
74 check("wgMathNames", $lang, $text);
75 check("wgUserToggles", $lang, $text);
76 check("wgWeekdayNames", $lang, $text);
77 check("wgMonthNames", $lang, $text);
78 check("wgMonthAbbreviations", $lang, $text);
79 check("wgValidSpecialPages", $lang, $text);
80 check("wgSysopSpecialPages", $lang, $text);
81 check("wgDeveloperSpecialPages", $lang, $text);
82 check("wgAllMessages", $lang, $text);
83 check("wgMagicWords", $lang, $text);
88 $glob = implode( " ", $argv );
90 $glob = "../languages/Language?*.php";
96 $enText = getLanguage( "" );
97 $filenames = glob( $glob );
99 foreach ( $filenames as $filename ) {
100 if ( preg_match( "/languages\/Language(.*)\.php/", $filename, $m ) ) {
101 $lang = strtolower( $m[1] );
102 if ( $lang != "utf8" ) {
103 print "\n" . str_repeat( "-", $width );
105 print str_repeat( "-", $width ) . "\n";
106 checkLanguage( $lang, $enText );
111 print "\n" . str_repeat( "-", $width ) . "\n";
112 print "{$count} messages of {$total} not translated.\n";