r50386 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50385‎ | r50386 | r50387 >
Date:20:50, 9 May 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
* Fix displaying of variables in definitions
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/MessageGroups.php
@@ -606,8 +606,12 @@
607607
608608 $defs = array();
609609 $prefix = $this->title->getPrefixedText() . '/';
 610+ $re = '~<tvar\|([^>]+)>(.*?)</>~u';
610611 foreach ( $res as $r ) {
611 - $defs[$r->trs_key] = $r->trs_text;
 612+ //TODO: use getTextForTrans?
 613+ $text = $r->trs_text;
 614+ $text = preg_replace( $re, '$\1', $text );
 615+ $defs[$r->trs_key] = $text;
612616 }
613617 // Some hacks to get nice order for the messages
614618 ksort( $defs );

Status & tagging log