Index: trunk/phase3/languages/LanguageConverter.php |
— | — | @@ -208,10 +208,10 @@ |
209 | 209 | * @private |
210 | 210 | */ |
211 | 211 | function captionConvert( $matches ) { |
212 | | - // we convert captions except URL |
213 | 212 | $toVariant = $this->getPreferredVariant(); |
214 | 213 | $title = $matches[1]; |
215 | 214 | $text = $matches[2]; |
| 215 | + // we convert captions except URL |
216 | 216 | if( !strpos( $text, '://' ) ) |
217 | 217 | $text = $this->translate($text, $toVariant); |
218 | 218 | return " $title=\"$text\""; |
— | — | @@ -372,12 +372,19 @@ |
373 | 373 | if( !in_array($v,$this->mVariants) )continue; |
374 | 374 | if( $action=="add" ) { |
375 | 375 | foreach($t as $from=>$to) { |
376 | | - // more efficient than array_merge(), about 2.5 times. |
377 | | - $this->mManualAddTables[$v][$from] = $to; |
| 376 | + // to ensure that $from and $to not be left blank |
| 377 | + // so $this->translate() could always return a string |
| 378 | + if ($from || $to) |
| 379 | + // more efficient than array_merge(), about 2.5 times. |
| 380 | + $this->mManualAddTables[$v][$from] = $to; |
378 | 381 | } |
379 | 382 | } |
380 | | - elseif ( $action=="remove" ) |
381 | | - $this->mManualRemoveTables[$v] = array_merge($this->mManualRemoveTables[$v], $t); |
| 383 | + elseif ( $action=="remove" ) { |
| 384 | + foreach($t as $from=>$to) { |
| 385 | + if ($from || $to) |
| 386 | + $this->mManualRemoveTables[$v][$from] = $to; |
| 387 | + } |
| 388 | + } |
382 | 389 | } |
383 | 390 | } |
384 | 391 | |