Index: trunk/extensions/Translate/tag/Tag.php |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | // Do in-place replace of variables, copy to keep $section intact for |
133 | 133 | // the replace later |
134 | 134 | $replace = $section; |
135 | | - $this->extractVariablesFromSection( $replace, true ); |
| 135 | + $this->extractVariablesFromSection( $replace, 'replace' ); |
136 | 136 | $replace = '<div class="mw-translate-other">' . "\n" . $replace . "\n". '</div>'; |
137 | 137 | $input = str_replace( $section, $replace, $input ); |
138 | 138 | $input = str_replace( $match['holder'], '', $input ); |
— | — | @@ -162,7 +162,10 @@ |
163 | 163 | // Store array or replace, replacement for easy replace afterwards |
164 | 164 | $vars[$id] = array( '$' . $id, $match['value'] ); |
165 | 165 | // If requested, subst them immediately |
166 | | - if ( $subst ) $text = str_replace( $match[0], $match['value'], $text ); |
| 166 | + if ( $subst === 'replace' ) |
| 167 | + $text = str_replace( $match[0], $match['value'], $text ); |
| 168 | + elseif ( $subst === 'holder' ) |
| 169 | + $text = str_replace( $match[0], '$' . $id, $text ); |
167 | 170 | } |
168 | 171 | |
169 | 172 | return $vars; |
— | — | @@ -246,6 +249,7 @@ |
247 | 250 | $key = $match['id']; |
248 | 251 | $contents = str_replace( $match['holder'], '', $match['section'] ); |
249 | 252 | list( , $key ) = explode( ':', $obj->getTranslationPage( $title, $key ), 2); |
| 253 | + $obj->extractVariablesFromSection( $contents, 'holder' ); |
250 | 254 | $defs[$key] = $contents; |
251 | 255 | } |
252 | 256 | |