r16971 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16970‎ | r16971 | r16972 >
Date:13:29, 12 October 2006
Author:rotem
Status:old
Tags:
Comment:
Removing the language maintenance scripts checktrans.php, duplicatetrans.php and unusedMessages.php, as they are obsolete and shouldn't be used - checkLanguage.php should be used instead of them, as it checks for more problems, contains much more features, and treats the ignored and optional messages right.
Modified paths:
  • /trunk/phase3/maintenance/language/checktrans.php (deleted) (history)
  • /trunk/phase3/maintenance/language/duplicatetrans.php (deleted) (history)
  • /trunk/phase3/maintenance/language/unusedMessages.php (deleted) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/unusedMessages.php
@@ -1,42 +0,0 @@
2 -<?php
3 -/**
4 - * Prints out messages in localisation files that are no longer used.
5 - *
6 - * @package MediaWiki
7 - * @subpackage Maintenance
8 - */
9 -
10 -require_once(dirname(__FILE__).'/../commandLine.inc');
11 -
12 -if ( isset( $args[0] ) ) {
13 - $code = $args[0];
14 -} else {
15 - $code = $wgLang->getCode();
16 -}
17 -
18 -if ( $code == 'en' ) {
19 - print "Current selected language is English. Cannot check translations.\n";
20 - exit();
21 -}
22 -
23 -$filename = Language::getMessagesFileName( $code );
24 -if ( file_exists( $filename ) ) {
25 - require( $filename );
26 -} else {
27 - $messages = array();
28 -}
29 -
30 -$count = $total = 0;
31 -$wgEnglishMessages = Language::getMessagesFor( 'en' );
32 -$wgLocalMessages = $messages;
33 -
34 -foreach ( $wgLocalMessages as $key => $msg ) {
35 - ++$total;
36 - if ( !isset( $wgEnglishMessages[$key] ) ) {
37 - print "* $key\n";
38 - ++$count;
39 - }
40 -}
41 -
42 -print "{$count} messages of {$total} are unused in the language {$code}\n";
43 -?>
Index: trunk/phase3/maintenance/language/duplicatetrans.php
@@ -1,43 +0,0 @@
2 -<?php
3 -/**
4 - * Prints out messages that are the same as the message with the corrisponding
5 - * key in the English file
6 - *
7 - * @package MediaWiki
8 - * @subpackage Maintenance
9 - */
10 -
11 -require_once(dirname(__FILE__).'/../commandLine.inc');
12 -
13 -if ( isset( $args[0] ) ) {
14 - $code = $args[0];
15 -} else {
16 - $code = $wgLang->getCode();
17 -}
18 -
19 -if ( $code == 'en' ) {
20 - print "Current selected language is English. Cannot check translations.\n";
21 - exit();
22 -}
23 -
24 -$filename = Language::getMessagesFileName( $code );
25 -if ( file_exists( $filename ) ) {
26 - require( $filename );
27 -} else {
28 - $messages = array();
29 -}
30 -
31 -$count = $total = 0;
32 -$wgEnglishMessages = Language::getMessagesFor( 'en' );
33 -$wgLocalMessages = $messages;
34 -
35 -foreach ( $wgLocalMessages as $key => $msg ) {
36 - ++$total;
37 - if ( @$wgEnglishMessages[$key] == $msg ) {
38 - echo "* $key\n";
39 - ++$count;
40 - }
41 -}
42 -
43 -echo "{$count} messages of {$total} are duplicates in the language {$code}\n";
44 -?>
Index: trunk/phase3/maintenance/language/checktrans.php
@@ -1,44 +0,0 @@
2 -<?php
3 -/**
4 - * @package MediaWiki
5 - * @subpackage Maintenance
6 - * Check to see if all messages have been translated into the selected language.
7 - * To run this script, you must have a working installation, and you can specify
8 - * a language, or the script will check the installation language.
9 - */
10 -
11 -/** */
12 -require_once(dirname(__FILE__).'/../commandLine.inc');
13 -
14 -if ( isset( $args[0] ) ) {
15 - $code = $args[0];
16 -} else {
17 - $code = $wgLang->getCode();
18 -}
19 -
20 -if ( $code == 'en' ) {
21 - print "Current selected language is English. Cannot check translations.\n";
22 - exit();
23 -}
24 -
25 -$filename = Language::getMessagesFileName( $code );
26 -if ( file_exists( $filename ) ) {
27 - require( $filename );
28 -} else {
29 - $messages = array();
30 -}
31 -
32 -$count = $total = 0;
33 -$wgEnglishMessages = Language::getMessagesFor( 'en' );
34 -$wgLocalMessages = $messages;
35 -
36 -foreach ( $wgEnglishMessages as $key => $msg ) {
37 - ++$total;
38 - if ( !isset( $wgLocalMessages[$key] ) ) {
39 - print "'{$key}' => \"$msg\",\n";
40 - ++$count;
41 - }
42 -}
43 -
44 -print "{$count} messages of {$total} are not translated in the language {$code}.\n";
45 -?>