http://www.mediawiki.org/wiki/Special:Code/MediaWiki/54865
Revision: 54865 Author: siebrand Date: 2009-08-12 15:00:58 +0000 (Wed, 12 Aug 2009) Log Message: ----------- * new style magic words support for Interlanguage * add localisation support for Interlanguage magic and messages in Translate * minor cleanup in extension credits * bump version Modified Paths: -------------- trunk/extensions/Interlanguage/Interlanguage.i18n.php trunk/extensions/Interlanguage/Interlanguage.php trunk/extensions/Translate/groups/mediawiki-defines.txt Added Paths: ----------- trunk/extensions/Interlanguage/Interlanguage.i18n.magic.php Added: trunk/extensions/Interlanguage/Interlanguage.i18n.magic.php =================================================================== --- trunk/extensions/Interlanguage/Interlanguage.i18n.magic.php (rev 0) +++ trunk/extensions/Interlanguage/Interlanguage.i18n.magic.php 2009-08-12 15:00:58 UTC (rev 54865) @@ -0,0 +1,7 @@ +<?php + +$magicWords = array(); + +$magicWords['en'] = array( + 'interlanguage' => array( 0, 'interlanguage' ), +); Property changes on: trunk/extensions/Interlanguage/Interlanguage.i18n.magic.php ___________________________________________________________________ Added: svn:keywords + Id Added: svn:eol-style + native Modified: trunk/extensions/Interlanguage/Interlanguage.i18n.php =================================================================== --- trunk/extensions/Interlanguage/Interlanguage.i18n.php 2009-08-12 14:56:07 UTC (rev 54864) +++ trunk/extensions/Interlanguage/Interlanguage.i18n.php 2009-08-12 15:00:58 UTC (rev 54865) @@ -5,6 +5,8 @@ * @addtogroup Extensions */ +require_once( dirname(__FILE__) . '/Interlanguage.i18n.magic.php' ); + $messages = array(); $messages['en'] = array( Modified: trunk/extensions/Interlanguage/Interlanguage.php =================================================================== --- trunk/extensions/Interlanguage/Interlanguage.php 2009-08-12 14:56:07 UTC (rev 54864) +++ trunk/extensions/Interlanguage/Interlanguage.php 2009-08-12 15:00:58 UTC (rev 54865) @@ -21,13 +21,12 @@ # http://www.mediawiki.org/wiki/Extension:Interlanguage $wgExtensionFunctions[]="wfInterlanguageExtension"; -$wgHooks['LanguageGetMagic'][] = 'wfInterlanguageExtensionMagic'; $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'Interlanguage', 'author' => 'Nikola Smolenski', 'url' => 'http://www.mediawiki.org/wiki/Extension:Interlanguage', - 'version' => '1.1',//preg_replace('/^.* (\d\d\d\d-\d\d-\d\d) .*$/', '\1', '$LastChangedDate$'), #just the date of the last change + 'version' => '1.2', 'description' => 'Grabs interlanguage links from another wiki', 'descriptionmsg' => 'interlanguage-desc', ); @@ -37,11 +36,6 @@ $wgParser->setFunctionHook( 'interlanguage', 'InterlanguageExtension', SFH_NO_HASH ); } -function wfInterlanguageExtensionMagic( &$magicWords, $langCode ) { - $magicWords['interlanguage'] = array(0, 'interlanguage'); - return true; -} - function InterlanguageExtension( &$parser, $param) { global $wgInterlanguageExtensionApiUrl, $wgInterlanguageExtensionSort, $wgInterlanguageExtensionPrefix, $wgInterlanguageExtensionInterwiki, @@ -51,7 +45,7 @@ $param = "$wgInterlanguageExtensionPrefix$param"; } - $url = $wgInterlanguageExtensionApiUrl . "?action=query&prop=langlinks&" . + $url = $wgInterlanguageExtensionApiUrl . "?action=query&prop=langlinks&" . "lllimit=500&format=php&redirects&titles=" . strtr( $param, ' ', '_' ); $key = wfMemcKey( 'Interlanguage', md5( $url ) ); $res = $wgMemc->get( $key ); Modified: trunk/extensions/Translate/groups/mediawiki-defines.txt =================================================================== --- trunk/extensions/Translate/groups/mediawiki-defines.txt 2009-08-12 14:56:07 UTC (rev 54864) +++ trunk/extensions/Translate/groups/mediawiki-defines.txt 2009-08-12 15:00:58 UTC (rev 54865) @@ -493,6 +493,9 @@ Inspect Cache aliasfile = InspectCache/InspectCache.alias.php +Interlanguage +magicfile = Interlanguage/Interlanguage.i18n.magic.php + Intersection file = intersection/DynamicPageList.i18n.php _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs