blob: 7d16915a7d951ad2e2c0f10335ca12936b968bfa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
<?php
require_once( dirname(__FILE__).'/../commandLine.inc' );
global $IP;
if ( !isset( $args[0] ) ) {
$dir = "$IP/languages/messages";
} else {
$dir = $args[0];
}
$total = 0;
$nonZero = 0;
foreach ( glob( "$dir/*.php" ) as $file ) {
$baseName = basename( $file );
if( !preg_match( '/Messages([A-Z][a-z_]+)\.php$/', $baseName, $m ) ) {
continue;
}
$code = str_replace( '_', '-', strtolower( $m[1] ) );
$numMessages = wfGetNumMessages( $file );
//print "$code: $numMessages\n";
$total += $numMessages;
if ( $numMessages > 0 ) {
$nonZero ++;
}
}
print "\nTotal: $total\n";
print "Languages: $nonZero\n";
function wfGetNumMessages( $file ) {
// Separate function to limit scope
require( $file );
if ( isset( $messages ) ) {
return count( $messages );
} else {
return 0;
}
}
|