Index: trunk/extensions/Translate/SpecialMagic.php |
— | — | @@ -255,10 +255,11 @@ |
256 | 256 | if ( $name === '' || $values === '' ) continue; |
257 | 257 | |
258 | 258 | $data = array_map( 'trim', explode( ',', $values ) ); |
259 | | - $array[$name] = $values; |
| 259 | + $array[$name] = $data; |
260 | 260 | |
261 | 261 | } |
262 | 262 | |
| 263 | + |
263 | 264 | return $array; |
264 | 265 | } |
265 | 266 | |
— | — | @@ -444,12 +445,16 @@ |
445 | 446 | $text = ''; |
446 | 447 | |
447 | 448 | foreach ( $groups as $group => $data ) { |
448 | | - $text .= "# $group \n"; |
449 | 449 | |
450 | 450 | $var = $data['var']; |
451 | 451 | $items = $data['data']; |
452 | 452 | |
453 | | - $text .= "\$$var = array(\n"; |
| 453 | + $extra = ''; |
| 454 | + if ( $data['code'] ) { |
| 455 | + $extra = "['{$this->language}']"; |
| 456 | + } |
| 457 | + |
| 458 | + $out = ''; |
454 | 459 | $padTo = max(array_map( 'strlen', array_keys($items[self::LANG_MASTER]) )) +3; |
455 | 460 | |
456 | 461 | foreach ( $this->getIterator($group) as $key ) { |
— | — | @@ -464,10 +469,13 @@ |
465 | 470 | } else { |
466 | 471 | $temp .= "=> " . implode( ', ', $normalized ) . ","; |
467 | 472 | } |
468 | | - $text .= $temp . "\n"; |
| 473 | + $out .= $temp . "\n"; |
469 | 474 | } |
470 | 475 | |
471 | | - $text .= ");\n\n"; |
| 476 | + if ( $out !== '' ) { |
| 477 | + $text .= "# $group \n"; |
| 478 | + $text .= "\$$var$extra = array(\n" . $out . ");\n\n"; |
| 479 | + } |
472 | 480 | |
473 | 481 | } |
474 | 482 | |