(bug 6827) some i18n specific maintenance scripts fails after merge of localisation...
[lhc/web/wiklou.git] / maintenance / duplicatetrans.php
1 <?php
2 /**
3 * Prints out messages that are the same as the message with the corrisponding
4 * key in the English file
5 *
6 * @package MediaWiki
7 * @subpackage Maintenance
8 */
9
10 require_once('commandLine.inc');
11
12 echo "Note: the script also lists the messages which are not defined in this language file, please wait for the bugfix.\n\n";
13
14 if ( $wgLang->getCode() == 'en' ) {
15 print "Current selected language is English. Cannot check translations.\n";
16 exit();
17 }
18
19 $count = $total = 0;
20 $wgEnglishLang = Language::factory( 'en' );
21 $wgEnglishMessages = $wgEnglishLang->getAllMessages();
22 $wgLocalMessages = $wgLang->getAllMessages();
23
24 foreach ( $wgEnglishMessages as $code => $msg ) {
25 ++$total;
26 if ( $wgLocalMessages[$code] == $wgEnglishMessages[$code] ) {
27 echo "* $code\n";
28 ++$count;
29 }
30 }
31
32 echo "{$count} messages of {$total} are duplicates\n";
33 ?>