r28811 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r28810‎ | r28811 | r28812 >
Date:21:19, 23 December 2007
Author:nikerabbit
Status:old
Tags:
Comment:
* Save memory
* Bug with references
Modified paths:
  • /trunk/extensions/Translate/Message.php (modified) (history)
  • /trunk/extensions/Translate/groupStatistics.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/groupStatistics.php
@@ -138,14 +138,15 @@
139139 $g->fill( $messages, $code );
140140
141141 // Remove untranslated messages from the list
142 - foreach ( $messages as $key => $o ) {
143 - if ( $o->translation === null ) {
 142+ foreach ( $messages->keys() as $key ) {
 143+ if ( $messages[$key]->translation === null ) {
144144 unset( $messages[$key] );
145145 }
146146 }
147147
148148 // Count the completion percent and output it
149149 $translated = count( $messages );
 150+
150151 $out->element( $out->formatPercent( $translated, $total,
151152 /* Inverted color */ false, /* Decimals */ 2 )
152153 );
Index: trunk/extensions/Translate/Message.php
@@ -168,13 +168,13 @@
169169 return strpos($this->database, TRANSLATE_FUZZY) !== false;
170170 }
171171
172 - private $fProperties = array( 'authors', 'changed', 'translated', 'translation', 'fuzzy' );
 172+ private static $fProperties = array( 'authors', 'changed', 'translated', 'translation', 'fuzzy' );
173173
174174 public function __get( $name ) {
175175 if ( isset( $this->$name) ) {
176176 return $this->$name;
177177 } else {
178 - if ( in_array( $name, $this->fProperties ) ) {
 178+ if ( in_array( $name, self::$fProperties ) ) {
179179 return $this->$name();
180180 }
181181 }

Status & tagging log