r102174 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102173‎ | r102174 | r102175 >
Date:12:25, 6 November 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Fixed compatibility with 1.17
Modified paths:
  • /trunk/extensions/Translate/ffs/Gettext.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/ffs/Gettext.php
@@ -323,7 +323,7 @@
324324 }
325325
326326 protected function doGettextHeader( MessageCollection $collection, $template, &$pluralCount ) {
327 - global $wgSitename, $wgCanonicalServer;
 327+ global $wgSitename, $wgServer, $wgCanonicalServer;
328328
329329 $code = $collection->code;
330330 $name = TranslateUtils::getLanguageName( $code );
@@ -345,8 +345,15 @@
346346 // Make sure there is no empty line before msgid
347347 $output = trim( $output ) . "\n";
348348
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+ }
351358
352359 $specs = isset( $template['HEADERS'] ) ? $template['HEADERS'] : array();
353360
@@ -363,7 +370,7 @@
364371 $specs['Content-Type'] = 'text/plain; charset=UTF-8';
365372 $specs['Content-Transfer-Encoding'] = '8bit';
366373 $specs['X-Generator'] = $this->getGenerator();
367 - $specs['X-Translation-Project'] = "$wgSitename at $wgCanonicalServer";
 374+ $specs['X-Translation-Project'] = "$wgSitename at $server";
368375 $specs['X-Language-Code'] = $code;
369376 if ( $this->offlineMode ) {
370377 $specs['X-Message-Group'] = $this->group->getId();

Status & tagging log