https://www.mediawiki.org/wiki/Special:Code/MediaWiki/102174

Revision: 102174
Author:   nikerabbit
Date:     2011-11-06 12:25:47 +0000 (Sun, 06 Nov 2011)
Log Message:
-----------
Fixed compatibility with 1.17

Modified Paths:
--------------
    trunk/extensions/Translate/ffs/Gettext.php

Modified: trunk/extensions/Translate/ffs/Gettext.php
===================================================================
--- trunk/extensions/Translate/ffs/Gettext.php  2011-11-06 12:25:34 UTC (rev 
102173)
+++ trunk/extensions/Translate/ffs/Gettext.php  2011-11-06 12:25:47 UTC (rev 
102174)
@@ -323,7 +323,7 @@
        }
 
        protected function doGettextHeader( MessageCollection $collection, 
$template, &$pluralCount ) {
-               global $wgSitename, $wgCanonicalServer;
+               global $wgSitename, $wgServer, $wgCanonicalServer;
 
                $code = $collection->code;
                $name = TranslateUtils::getLanguageName( $code );
@@ -345,8 +345,15 @@
                // Make sure there is no empty line before msgid
                $output = trim( $output ) . "\n";
 
-               // @todo twn specific
-               $portal = Title::makeTitle( NS_PORTAL, $code 
)->getCanonicalUrl();
+               // @todo portal is twn specific
+               // BC for MW <1.18
+               if ( method_exists( 'Title', 'getCanonicalUrl' ) ) {
+                       $portal = Title::makeTitle( NS_PORTAL, $code 
)->getCanonicalUrl();
+                       $server = $wgCanonicalServer;
+               } else {
+                       $portal = Title::makeTitle( NS_PORTAL, $code 
)->getFullUrl();
+                       $server = $wgServer;
+               }
 
                $specs = isset( $template['HEADERS'] ) ? $template['HEADERS'] : 
array();
 
@@ -363,7 +370,7 @@
                $specs['Content-Type'] = 'text/plain; charset=UTF-8';
                $specs['Content-Transfer-Encoding'] = '8bit';
                $specs['X-Generator'] = $this->getGenerator();
-               $specs['X-Translation-Project'] = "$wgSitename at 
$wgCanonicalServer";
+               $specs['X-Translation-Project'] = "$wgSitename at $server";
                $specs['X-Language-Code'] = $code;
                if ( $this->offlineMode ) {
                        $specs['X-Message-Group'] = $this->group->getId();


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to