Index: trunk/extensions/Translate/Groups.php |
— | — | @@ -209,9 +209,13 @@ |
210 | 210 | $messages = array(); |
211 | 211 | |
212 | 212 | $cache = new MessageGroupCache( $this ); |
213 | | - |
214 | | - foreach ( $cache->getKeys() as $key ) { |
215 | | - $messages[$key] = $cache->get( $key ); |
| 213 | + if ( !$cache->exists() ) { |
| 214 | + wfWarn( "By-passing message group cache" ); |
| 215 | + $messages = $this->load( 'en' ); |
| 216 | + } else { |
| 217 | + foreach ( $cache->getKeys() as $key ) { |
| 218 | + $messages[$key] = $cache->get( $key ); |
| 219 | + } |
216 | 220 | } |
217 | 221 | |
218 | 222 | $definitions = new MessageDefinitions( $namespace, $messages ); |
Index: trunk/extensions/Translate/ffs/Gettext.php |
— | — | @@ -625,7 +625,9 @@ |
626 | 626 | // WRITE |
627 | 627 | // |
628 | 628 | protected function writeReal( MessageCollection $collection ) { |
629 | | - $output = $this->doHeader( $collection ); |
| 629 | + $pot = $this->read( 'en' ); |
| 630 | + $template = $this->read( $collection->code ); |
| 631 | + $output = $this->doGettextHeader( $collection, $template ); |
630 | 632 | |
631 | 633 | $mangler = $this->group->getMangler(); |
632 | 634 | $messages = array(); |
— | — | @@ -646,7 +648,7 @@ |
647 | 649 | return $output; |
648 | 650 | } |
649 | 651 | |
650 | | - protected function doHeader( MessageCollection $collection ) { |
| 652 | + protected function doGettextHeader( MessageCollection $collection, $template ) { |
651 | 653 | global $wgSitename, $wgServer; |
652 | 654 | $code = $collection->code; |
653 | 655 | $name = TranslateUtils::getLanguageName( $code ); |
— | — | @@ -669,10 +671,10 @@ |
670 | 672 | /// @todo twn specific |
671 | 673 | $portal = Title::makeTitle( NS_PORTAL, $code )->getFullUrl(); |
672 | 674 | |
673 | | - $specs = array(); |
| 675 | + $specs = isset( $template['HEADERS'] ) ? $template['HEADERS'] : array(); |
674 | 676 | |
675 | 677 | $specs['Project-Id-Version'] = $this->group->getLabel(); |
676 | | - $specs['Report-Msgid-Bugs'] = $wgSitename; |
| 678 | + $specs['Report-Msgid-Bugs-To'] = $wgSitename; |
677 | 679 | $specs['POT-Creation-Date'] = self::formatTime( $this->getPotTime() ); |
678 | 680 | $specs['PO-Revision-Date'] = self::formatTime( wfTimestampNow() ); |
679 | 681 | $specs['Language-Team'] = "$name <$portal>"; |