Index: trunk/extensions/Translate/ffs/Gettext.php |
— | — | @@ -323,7 +323,7 @@ |
324 | 324 | } |
325 | 325 | |
326 | 326 | protected function doGettextHeader( MessageCollection $collection, $template, &$pluralCount ) { |
327 | | - global $wgSitename, $wgCanonicalServer; |
| 327 | + global $wgSitename, $wgServer, $wgCanonicalServer; |
328 | 328 | |
329 | 329 | $code = $collection->code; |
330 | 330 | $name = TranslateUtils::getLanguageName( $code ); |
— | — | @@ -345,8 +345,15 @@ |
346 | 346 | // Make sure there is no empty line before msgid |
347 | 347 | $output = trim( $output ) . "\n"; |
348 | 348 | |
349 | | - // @todo twn specific |
350 | | - $portal = Title::makeTitle( NS_PORTAL, $code )->getCanonicalUrl(); |
| 349 | + // @todo portal is twn specific |
| 350 | + // BC for MW <1.18 |
| 351 | + if ( method_exists( 'Title', 'getCanonicalUrl' ) ) { |
| 352 | + $portal = Title::makeTitle( NS_PORTAL, $code )->getCanonicalUrl(); |
| 353 | + $server = $wgCanonicalServer; |
| 354 | + } else { |
| 355 | + $portal = Title::makeTitle( NS_PORTAL, $code )->getFullUrl(); |
| 356 | + $server = $wgServer; |
| 357 | + } |
351 | 358 | |
352 | 359 | $specs = isset( $template['HEADERS'] ) ? $template['HEADERS'] : array(); |
353 | 360 | |
— | — | @@ -363,7 +370,7 @@ |
364 | 371 | $specs['Content-Type'] = 'text/plain; charset=UTF-8'; |
365 | 372 | $specs['Content-Transfer-Encoding'] = '8bit'; |
366 | 373 | $specs['X-Generator'] = $this->getGenerator(); |
367 | | - $specs['X-Translation-Project'] = "$wgSitename at $wgCanonicalServer"; |
| 374 | + $specs['X-Translation-Project'] = "$wgSitename at $server"; |
368 | 375 | $specs['X-Language-Code'] = $code; |
369 | 376 | if ( $this->offlineMode ) { |
370 | 377 | $specs['X-Message-Group'] = $this->group->getId(); |