#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# http://www.gnu.org/copyleft/gpl.html
/**
*
* The goal is to get a list of messages not yet localised in a languageXX.php
* file using the language.php file as reference.
- *
+ *
* The script then print a list of wgAllMessagesXX keys that aren't localised, a
* percentage of messages correctly localised and the number of messages to be
* translated.
- *
- * @package MediaWiki
- * @subpackage Maintenance
+ *
+ * @addtogroup Maintenance
*/
/** This script run from the commandline */
-require_once( 'parserTests.inc' );
-require_once( 'commandLine.inc' );
+require_once( dirname(__FILE__).'/../parserTests.inc' );
+require_once( dirname(__FILE__).'/../commandLine.inc' );
-if( isset($options['help']) ) { usage(); die(); }
+if( isset($options['help']) ) { usage(); wfDie(); }
$wgLanguageCode = ucfirstlcrest($wgLanguageCode);
/** Language messages we will use as reference. By default 'en' */
$referenceMessages = $wgAllMessagesEn;
$referenceLanguage = 'En';
$referenceFilename = 'Language'.$referenceLanguage.'.php';
-/** Language messages we will test. */
+/** Language messages we will test. */
$testMessages = array();
$testLanguage = '';
/** whereas we use an external language file */
$foo = "wgAllMessages$languageCode";
global $$foo;
+ global $wgSkinNamesEn; // potentially unused global declaration?
// it might already be loaded in LocalSettings.php
if(!isset($$foo)) {
global $IP;
- $langFile = $IP.'/languages/Language'.$languageCode.'.php';
+ $langFile = $IP.'/languages/classes/Language'.$languageCode.'.php';
if (file_exists( $langFile ) ) {
print "Including $langFile\n";
- global $wgNamespaceNamesEn;
+ global $wgNamespaceNamesEn; // potentially unused global declaration?
include($langFile);
- } else die("ERROR: The file $langFile does not exist !\n");
+ } else wfDie("ERROR: The file $langFile does not exist !\n");
}
return $$foo;
}
// Load datas from MediaWiki
$testMessages = getMediawikiMessages($lang);
- $testLanguage = $lang;
+ $testLanguage = $lang;
} else {
usage();
- die();
+ wfDie();
}
/** parsertest is used to do differences */
-$myParserTest =& new ParserTest();
+$myParserTest = new ParserTest();
# Get all references messages and check if they exist in the tested language
$i = 0;
print "'$index' => \"$ref\",\n";
// Messages in the same language differs
} elseif( ($lang == $referenceLanguage) AND ($testMessages[$index] != $ref)) {
- print "$index differs:\n";
+ print "\n$index differs:\n";
print $myParserTest->quickDiff($testMessages[$index],$ref,'tested','reference');
}
}
echo "\n----\n".$msg;
echo "$referenceLanguage language is complete at ".number_format((100 - $i/count($wgAllMessagesEn) * 100),2)."%\n";
echo "$i unlocalised messages of the ".count($wgAllMessagesEn)." messages available.\n";
-?>
+