r59150 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59149‎ | r59150 | r59151 >
Date:21:53, 16 November 2009
Author:siebrand
Status:deferred
Tags:
Comment:
Give StringMatcher::emptyMatcher() on getMangler() if mangler not set. Prevents fatal in exporting page translation groups to file. Export result is very basic for page translation now. Should return the raw/rendered wiki text?
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/MessageGroups.php
@@ -61,7 +61,16 @@
6262 * branches one can set a message key mangler.
6363 */
6464 protected $mangler = null;
65 - public function getMangler() { return $this->mangler; }
 65+ public function getMangler() {
 66+ $mangler = $this->mangler;
 67+
 68+ if( !$mangler ) {
 69+ $mangler = StringMatcher::emptyMatcher();
 70+ }
 71+
 72+ return $mangler;
 73+ }
 74+
6675 public function setMangler( $value ) { $this->mangler = $value; }
6776
6877 protected $type = 'undefined';
@@ -442,7 +451,7 @@
443452
444453 public function initCollection( $code, $unique = false ) {
445454 $collection = parent::initCollection( $code, $unique );
446 -
 455+
447456 $defs = $this->load( 'en' );
448457 foreach ( $defs as $key => $value ) {
449458 $collection[$key] = new FatMessage( $key, implode( ", ", $value ) );
Index: trunk/extensions/Translate/Translate.php
@@ -12,7 +12,7 @@
1313 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1414 */
1515
16 -define( 'TRANSLATE_VERSION', '2009-11-13' );
 16+define( 'TRANSLATE_VERSION', '2009-11-16' );
1717
1818 $wgExtensionCredits['specialpage'][] = array(
1919 'path' => __FILE__,

Status & tagging log