Index: trunk/phase3/languages/LanguageConverter.php |
— | — | @@ -296,12 +296,19 @@ |
297 | 297 | if( !in_array($v,$this->mVariants) )continue; |
298 | 298 | if( $action=="add" ) { |
299 | 299 | foreach($t as $from=>$to) { |
300 | | - // more efficient than array_merge(), about 2.5 times. |
301 | | - $this->mManualAddTables[$v][$from] = $to; |
| 300 | + // to ensure that $from and $to not be left blank |
| 301 | + // so $this->translate() could always return a string |
| 302 | + if ($from || $to) |
| 303 | + // more efficient than array_merge(), about 2.5 times. |
| 304 | + $this->mManualAddTables[$v][$from] = $to; |
302 | 305 | } |
303 | 306 | } |
304 | | - elseif ( $action=="remove" ) |
305 | | - $this->mManualRemoveTables[$v] = array_merge($this->mManualRemoveTables[$v], $t); |
| 307 | + elseif ( $action=="remove" ) { |
| 308 | + foreach($t as $from=>$to) { |
| 309 | + if ($from || $to) |
| 310 | + $this->mManualRemoveTables[$v][$from] = $to; |
| 311 | + } |
| 312 | + } |
306 | 313 | } |
307 | 314 | } |
308 | 315 | |