Index: trunk/extensions/Translate/ffs/Gettext.php |
— | — | @@ -626,13 +626,23 @@ |
627 | 627 | $template = $this->read( $collection->code ); |
628 | 628 | $output = $this->doGettextHeader( $collection, $template ); |
629 | 629 | foreach ( $collection as $key => $m ) { |
| 630 | + $transTemplate = isset( $template['TEMPLATE'][$key] ) ? |
| 631 | + $template['TEMPLATE'][$key] : array(); |
| 632 | + $potTemplate = isset( $pot['TEMPLATE'][$key] ) ? |
| 633 | + $pot['TEMPLATE'][$key] : array(); |
| 634 | + |
630 | 635 | $tags = $m->getTags(); |
631 | | - if ( $tags ) { |
632 | | - $output .= "#, " . implode( ', ', $tags ) . "\n"; |
| 636 | + $flags = isset( $transTemplate['flags'] ) ? $transTemplate['flags'] : array(); |
| 637 | + |
| 638 | + $outFlags = array_unique( array_merge( $tags, $flags ) ); |
| 639 | + |
| 640 | + if ( $outFlags ) { |
| 641 | + sort( $outFlags ); |
| 642 | + $output .= "#, " . implode( ', ', $outFlags ) . "\n"; |
633 | 643 | } |
634 | 644 | |
635 | | - if ( isset( $pot['TEMPLATE'][$key]['msgctxt'] ) ) { |
636 | | - $output .= 'msgctxt ' . self::escape( $pot['TEMPLATE'][$key]['msgctxt'] ) . "\n"; |
| 645 | + if ( isset( $potTemplate['msgctxt'] ) ) { |
| 646 | + $output .= 'msgctxt ' . self::escape( $potTemplate['msgctxt'] ) . "\n"; |
637 | 647 | } |
638 | 648 | |
639 | 649 | $translation = str_replace( TRANSLATE_FUZZY, '', $m->translation() ); |