http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90683
Revision: 90683
Author: robin
Date: 2011-06-24 00:07:57 +0000 (Fri, 24 Jun 2011)
Log Message:
-----------
localization statistics (transstat.php) now excludes language codes in
$wgDummyLanguageCodes (they have always 0%), with a list of them in the
description.
Modified Paths:
--------------
trunk/phase3/RELEASE-NOTES-1.19
trunk/phase3/maintenance/language/StatOutputs.php
trunk/phase3/maintenance/language/transstat.php
Modified: trunk/phase3/RELEASE-NOTES-1.19
===================================================================
--- trunk/phase3/RELEASE-NOTES-1.19 2011-06-23 23:25:49 UTC (rev 90682)
+++ trunk/phase3/RELEASE-NOTES-1.19 2011-06-24 00:07:57 UTC (rev 90683)
@@ -56,6 +56,8 @@
* (bug 29397) Implement mw.Title module in core.
* In MySQL 4.1.9+ with replication enabled, get the slave lag from SHOW SLAVE
STATUS instead of SHOW PROCESSLIST.
+* Language codes in $wgDummyLanguageCodes are now excluded on localization
+ statistics (maintenance/language/transstat.php)
=== Bug fixes in 1.19 ===
* (bug 28868) Show total pages in the subtitle of an image on the
Modified: trunk/phase3/maintenance/language/StatOutputs.php
===================================================================
--- trunk/phase3/maintenance/language/StatOutputs.php 2011-06-23 23:25:49 UTC
(rev 90682)
+++ trunk/phase3/maintenance/language/StatOutputs.php 2011-06-24 00:07:57 UTC
(rev 90683)
@@ -46,10 +46,19 @@
/** Outputs WikiText */
class wikiStatsOutput extends statsOutput {
function heading() {
+ global $wgDummyLanguageCodes, $wgContLang;
$version = SpecialVersion::getVersion( 'nodb' );
echo "'''Statistics are based on:''' <code>" . $version .
"</code>\n\n";
echo "'''Note:''' These statistics can be generated by running
<code>php maintenance/language/transstat.php</code>.\n\n";
echo "For additional information on specific languages (the
message names, the actual problems, etc.), run <code>php
maintenance/language/checkLanguage.php --lang=foo</code>.\n\n";
+ echo 'English (en) is excluded because it is the default
localization';
+ if( is_array( $wgDummyLanguageCodes ) ) {
+ foreach( $wgDummyLanguageCodes as $dummyCode ) {
+ $dummyCodes[] = $wgContLang->getLanguageName(
$dummyCode ) . ' (' . $dummyCode . ')';
+ }
+ echo ', as well as the following languages that are not
intended for system message translations, usually because they redirect to
other language codes: ' . implode( ', ', $dummyCodes );
+ }
+ echo ".\n\n"; # dot to end sentence
echo '{| class="sortable wikitable" border="2" cellpadding="4"
cellspacing="0" style="background-color: #F9F9F9; border: 1px #AAAAAA solid;
border-collapse: collapse; clear:both;" width="100%"' . "\n";
}
function footer() {
Modified: trunk/phase3/maintenance/language/transstat.php
===================================================================
--- trunk/phase3/maintenance/language/transstat.php 2011-06-23 23:25:49 UTC
(rev 90682)
+++ trunk/phase3/maintenance/language/transstat.php 2011-06-24 00:07:57 UTC
(rev 90683)
@@ -95,8 +95,9 @@
$wgRequiredMessagesNumber = count( $wgGeneralMessages['required'] );
foreach ( $wgLanguages->getLanguages() as $code ) {
- # Don't check English or RTL English
- if ( $code == 'en' || $code == 'enRTL' ) {
+ # Don't check English, RTL English or dummy language codes
+ if ( $code == 'en' || $code == 'enRTL' || (is_array(
$wgDummyLanguageCodes ) &&
+ in_array( $code, $wgDummyLanguageCodes ) ) ) {
continue;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs