r37685 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37684‎ | r37685 | r37686 >
Date:10:53, 15 July 2008
Author:nikerabbit
Status:old
Tags:
Comment:
* 2008-07-14:1
- improved message checks
- can now work for meta groups too
- fixed messages not shown in the list anymore, but script is still needed to find the broken ones
Modified paths:
  • /trunk/extensions/Translate/MessageChecks.php (modified) (history)
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/README (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/groups/MediaWikiExtensions.php (modified) (history)
  • /trunk/extensions/Translate/scripts/createCheckIndex.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/groups/MediaWikiExtensions.php
@@ -155,9 +155,18 @@
156156 protected $label = 'MediaWiki extensions';
157157 protected $id = 'ext-0-all';
158158 protected $meta = true;
159 -
 159+ protected $type = 'mediawiki';
160160 protected $classes = null;
161161
 162+ public function getProblematic( $code ) {
 163+ $this->init();
 164+ $array = array();
 165+ foreach ( $this->classes as $class ) {
 166+ $array = wfArrayMerge( $array, $class->getProblematic( $code ) );
 167+ }
 168+ return $array;
 169+ }
 170+
162171 // Don't add the (mw ext) thingie
163172 public function getLabel() { return $this->label; }
164173
@@ -189,7 +198,7 @@
190199 $this->init();
191200 $array = array();
192201 foreach ( $this->classes as $class ) {
193 - $array = array_merge( $array, $class->getDefinitions() );
 202+ $array = wfArrayMerge( $array, $class->getDefinitions() );
194203 }
195204 return $array;
196205 }
Index: trunk/extensions/Translate/Translate.php
@@ -11,7 +11,7 @@
1212 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1313 */
1414
15 -define( 'TRANSLATE_VERSION', '9 (2008-07-14:1)' );
 15+define( 'TRANSLATE_VERSION', '9 (2008-07-15:1)' );
1616
1717 $wgExtensionCredits['specialpage'][] = array(
1818 'name' => 'Translate',
Index: trunk/extensions/Translate/scripts/createCheckIndex.php
@@ -72,7 +72,7 @@
7373 }
7474
7575 // Add it to the array
76 - $problematic[$code][] = strtolower( "$namespace:$key" );
 76+ $problematic[$code][] = $key;
7777 }
7878 }
7979 }
Index: trunk/extensions/Translate/MessageChecks.php
@@ -51,7 +51,7 @@
5252 * @return Array of warning messages, html-format.
5353 */
5454 public function doChecks( TMessage $message, $type, $code ) {
55 - if ( $message->translation === null) return false;
 55+ if ( $message->translation === null) return array();
5656 $warnings = array();
5757
5858 foreach ( $this->checksForType[$type] as $check ) {
Index: trunk/extensions/Translate/README
@@ -34,6 +34,11 @@
3535
3636 == Changes in version 10 ==
3737
 38+* 2008-07-14:1
 39+ - improved message checks
 40+ - can now work for meta groups too
 41+ - fixed messages not shown in the list anymore, but script still needed to find
 42+ the broken ones
3843 * 2008-07-13:2 group filter for graphs
3944 * 2008-07-13:1 experimental alias-export for extensions
4045 * 2008-07-08:1 simple edit stats with phplot
Index: trunk/extensions/Translate/MessageGroups.php
@@ -30,6 +30,22 @@
3131 public function getIgnored() { return $this->ignored; }
3232 public function setIgnored( $value ) { $this->ignored = $value; }
3333
 34+ protected $problematic = null;
 35+ protected function getProblematic( $code ) {
 36+ if ( $this->problematic === null ) {
 37+ $this->problematic = array();
 38+ $file = TRANSLATE_CHECKFILE . '-' . $this->id;
 39+ if ( file_exists($file) ) {
 40+ $problematic = unserialize( file_get_contents($file) );
 41+ if ( isset($problematic[$code]) ) {
 42+ $this->problematic = $problematic[$code];
 43+ }
 44+ }
 45+ }
 46+ return $this->problematic;
 47+ }
 48+
 49+ protected function setProblematic( $value ) { $this->problematic = $value ; }
3450 /**
3551 * Returns a list of optional and ignored messages in 2-d array.
3652 */

Status & tagging log