3 die("This script is not being maintained.");
5 # Checks translation of all language files
7 function wfLocalUrl() { return "";}
8 function wfLocalUrle() { return "";}
10 function check($arrayname, $lang, $text)
12 $arraynameprinted = 0;
14 global $count, $total;
16 $msgarray = $arrayname . ucfirst( $lang );
17 $msgarrayen = $arrayname . "En";
20 if ( !is_array( $
$msgarrayen ) ) {
21 print "\nArray '$msgarrayen' not present\n";
23 } elseif ( !is_array( $
$msgarray ) ) {
24 print "\nArray '$msgarray' not present\n";
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;
37 if ( is_numeric( $code ) ) {
38 print "$code ($msg)\n";
47 function getLanguage( $lang )
49 $fileName = "../languages/Language" . ucfirst( $lang ) . ".php";
50 $file = fopen( $fileName, "r" );
51 $text = fread( $file, filesize( $fileName ) );
52 $clipPos = strpos( $text, "class Language" );
53 $text = substr( $text, 0, $clipPos );
54 $text = preg_replace( "/^<\?(php|)/", "", $text );
55 $text = preg_replace( "/^include.*$/m", "", $text );
60 function checkLanguage( $lang, $enText )
62 $text = $enText . getLanguage( $lang );
63 check("wgLanguageNames", $lang, $text);
64 check("wgNamespaceNames", $lang, $text);
65 check("wgDefaultUserOptions", $lang, $text);
66 check("wgQuickbarSettings", $lang, $text);
67 check("wgSkinNames", $lang, $text);
68 check("wgMathNames", $lang, $text);
69 check("wgUserToggles", $lang, $text);
70 check("wgWeekdayNames", $lang, $text);
71 check("wgMonthNames", $lang, $text);
72 check("wgMonthAbbreviations", $lang, $text);
73 check("wgValidSpecialPages", $lang, $text);
74 check("wgSysopSpecialPages", $lang, $text);
75 check("wgDeveloperSpecialPages", $lang, $text);
76 check("wgAllMessages", $lang, $text);
77 check("wgMagicWords", $lang, $text);
82 $glob = implode( " ", $argv );
84 $glob = "../languages/Language?*.php";
90 $enText = getLanguage( "" );
91 $filenames = glob( $glob );
93 foreach ( $filenames as $filename ) {
94 if ( preg_match( "/languages\/Language(.*)\.php/", $filename, $m ) ) {
95 $lang = strtolower( $m[1] );
96 if ( $lang != "utf8" ) {
97 print "\n" . str_repeat( "-", $width );
99 print str_repeat( "-", $width ) . "\n";
100 checkLanguage( $lang, $enText );
105 print "\n" . str_repeat( "-", $width ) . "\n";
106 print "{$count} messages of {$total} not translated.\n";