r40579 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40578‎ | r40579 | r40580 >
Date:10:06, 7 September 2008
Author:nikerabbit
Status:old
Tags:
Comment:
* Few fixes
Modified paths:
  • /trunk/extensions/Translate/ffs/PhpVariables.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/ffs/PhpVariables.php
@@ -98,7 +98,7 @@
9999 $data = file_get_contents( $this->filename );
100100
101101 $matches = array();
102 - $regex = '/^\$(.*?)\s*=\s*[\'"](.*?)[\'"];(\s*#.*?)?$/mus';
 102+ $regex = '/^\$(.*?)\s*=\s*[\'"](.*?)[\'"];.*?$/mus';
103103 preg_match_all( $regex, $data, $matches, PREG_SET_ORDER );
104104 $messages = array();
105105 foreach ( $matches as $_ ) {
@@ -165,12 +165,12 @@
166166 protected function exportMessages( $handle, MessageCollection $collection ) {
167167 $mangler = $this->group->getMangler();
168168 foreach ( $collection->keys() as $item ) {
169 - $value = $collection[$item]->translation;
170 - if ( $value === null ) continue;
171169
172170 $key = $mangler->unmangle($item);
173171 $key = stripcslashes( $key );
174172
 173+ $value = $collection[$item]->translation;
 174+ if ( $value === null ) $value = $collection[$item]->definition;
175175 $value = str_replace( TRANSLATE_FUZZY, '', $value );
176176 $value = addcslashes( $value, "'" );
177177