Index: trunk/extensions/Translate/ffs/Gettext.php |
— | — | @@ -352,7 +352,7 @@ |
353 | 353 | } |
354 | 354 | |
355 | 355 | protected function doGettextHeader( MessageCollection $collection, $template, &$pluralCount ) { |
356 | | - global $wgSitename, $wgServer, $wgCanonicalServer; |
| 356 | + global $wgSitename; |
357 | 357 | |
358 | 358 | $code = $collection->code; |
359 | 359 | $name = TranslateUtils::getLanguageName( $code ); |
— | — | @@ -374,33 +374,25 @@ |
375 | 375 | // Make sure there is no empty line before msgid |
376 | 376 | $output = trim( $output ) . "\n"; |
377 | 377 | |
378 | | - // @todo portal is twn specific |
379 | | - $portal = Title::makeTitle( NS_PORTAL, $code )->getCanonicalUrl(); |
380 | | - $server = $wgCanonicalServer; |
381 | | - |
382 | 378 | $specs = isset( $template['HEADERS'] ) ? $template['HEADERS'] : array(); |
383 | 379 | |
384 | 380 | $timestamp = wfTimestampNow(); |
385 | | - $specs['Project-Id-Version'] = $this->group->getLabel(); |
386 | | - $specs['Report-Msgid-Bugs-To'] = $wgSitename; |
387 | 381 | $specs['PO-Revision-Date'] = self::formatTime( $timestamp ); |
388 | 382 | if ( $this->offlineMode ) { |
389 | 383 | $specs['POT-Creation-Date'] = self::formatTime( $timestamp ); |
390 | 384 | } elseif ( $this->group instanceof MessageGroupBase ) { |
391 | 385 | $specs['X-POT-Import-Date'] = self::formatTime( wfTimestamp( TS_MW, $this->getPotTime() ) ); |
392 | 386 | } |
393 | | - $specs['Language-Team'] = "$name <$portal>"; |
394 | 387 | $specs['Content-Type'] = 'text/plain; charset=UTF-8'; |
395 | 388 | $specs['Content-Transfer-Encoding'] = '8bit'; |
| 389 | + wfRunHooks( 'Translate:GettextFFS:headerFields', array( &$specs, $this->group, $code ) ); |
396 | 390 | $specs['X-Generator'] = $this->getGenerator(); |
397 | | - $specs['X-Translation-Project'] = "$wgSitename at $server"; |
398 | | - $specs['X-Language-Code'] = $code; |
| 391 | + |
399 | 392 | if ( $this->offlineMode ) { |
| 393 | + $specs['X-Language-Code'] = $code; |
400 | 394 | $specs['X-Message-Group'] = $this->group->getId(); |
401 | | - } else { |
402 | | - // Prepend # so that message import does not think this is a file it can import |
403 | | - $specs['X-Message-Group'] = '#' . $this->group->getId(); |
404 | 395 | } |
| 396 | + |
405 | 397 | $plural = self::getPluralRule( $code ); |
406 | 398 | if ( $plural ) { |
407 | 399 | $specs['Plural-Forms'] = $plural; |