PADLEFT/PADRIGHT:
[mediawiki.git] / maintenance / duplicatetrans.php
blobe36b929c765d10159f2eda3a531632e24cf11449
1 <?php
2 /**
3 * Prints out messages that are the same as the message with the corrisponding
4 * key in the English file
6 * @package MediaWiki
7 * @subpackage Maintenance
8 */
10 require_once('commandLine.inc');
12 if ( isset( $args[0] ) ) {
13 $code = $args[0];
14 } else {
15 $code = $wgLang->getCode();
18 if ( $code == 'en' ) {
19 print "Current selected language is English. Cannot check translations.\n";
20 exit();
23 $filename = Language::getFileName( "$IP/languages/Messages", $code, '.php' );
24 if ( file_exists( $filename ) ) {
25 require( $filename );
26 } else {
27 $messages = array();
30 $count = $total = 0;
31 $wgEnglishMessages = Language::getMessagesFor( 'en' );
32 $wgLocalMessages = $messages;
34 foreach ( $wgLocalMessages as $key => $msg ) {
35 ++$total;
36 if ( @$wgEnglishMessages[$key] == $msg ) {
37 echo "* $key\n";
38 ++$count;
42 echo "{$count} messages of {$total} are duplicates in the language {$code}\n";