r54817 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54816‎ | r54817 | r54818 >
Date:22:07, 11 August 2009
Author:siebrand
Status:deferred
Tags:
Comment:
* new style magic words support for MathStatFunctions
* add localisation support for MathStatFunctions magic in Translate
* bump version
Modified paths:
  • /trunk/extensions/MathStatFunctions/MathStatFunctions.i18n.magic.php (modified) (history)
  • /trunk/extensions/MathStatFunctions/MathStatFunctions.i18n.php (modified) (history)
  • /trunk/extensions/MathStatFunctions/MathStatFunctions.php (modified) (history)
  • /trunk/extensions/Translate/groups/mediawiki-defines.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/MathStatFunctions/MathStatFunctions.i18n.magic.php
@@ -1,12 +1,11 @@
22 <?php
 3+/**
 4+ * Magic word localization for the MathStatFunction extension
 5+*/
36
4 -if ( !defined( 'MEDIAWIKI' ) ) {
5 - die( 'This file is a MediaWiki extension, it is not a valid entry point' );
6 -}
 7+$magicWords = array();
78
8 -$wgMathStatFunctionsMagic = array();
9 -
10 -$wgMathStatFunctionsMagic['en'] = array(
 9+$magicWords['en'] = array(
1110 'const' => array( 0, 'const' ),
1211 'median' => array( 0, 'median' ),
1312 'mean' => array( 0, 'mean' ),
Index: trunk/extensions/MathStatFunctions/MathStatFunctions.i18n.php
@@ -5,6 +5,8 @@
66 * @addtogroup Extensions
77 */
88
 9+require_once( dirname( __FILE__ ) . '/MathStatFunctions.i18n.magic.php' );
 10+
911 $messages = array();
1012
1113 $messages['en'] = array(
Index: trunk/extensions/MathStatFunctions/MathStatFunctions.php
@@ -7,7 +7,7 @@
88 $wgExtensionCredits['parserhook'][] = array(
99 'path' => __FILE__,
1010 'name' => 'MathStatFunctions',
11 - 'version' => '1.1',
 11+ 'version' => '1.2',
1212 'author' => 'Carl Fürstenberg (AzaToth)',
1313 'description' => 'A collection of mathematical and statistical functions',
1414 'descriptionmsg' => 'msfunc_desc',
@@ -16,7 +16,6 @@
1717
1818 $wgExtensionMessagesFiles['MathStatFunctions'] = dirname( __FILE__ ) . '/MathStatFunctions.i18n.php';
1919 $wgExtensionFunctions[] = 'wfSetupMathStatFunctions';
20 -$wgHooks['LanguageGetMagic'][] = 'wfMathStatFunctionsLanguageGetMagic';
2120
2221 /**
2322 * \brief Exception class identifying that ParserFunctions is not available
@@ -456,12 +455,3 @@
457456
458457 return true;
459458 }
460 -
461 -function wfMathStatFunctionsLanguageGetMagic( &$magicWords, $langCode ) {
462 - global $wgMathStatFunctionsMagic;
463 - require_once( dirname(__FILE__) . '/MathStatFunctions.i18n.magic.php' );
464 -
465 - if ( !in_array( $langCode, $wgMathStatFunctionsMagic ) ) $langCode = 'en';
466 - $magicWords = array_merge( $magicWords, $wgMathStatFunctionsMagic[$langCode] );
467 - return true;
468 -}
Index: trunk/extensions/Translate/groups/mediawiki-defines.txt
@@ -550,9 +550,9 @@
551551 descmsg = maps_desc
552552 optional = maps_name
553553
554 -Math Stat
555 -file = MathStatFunctions/MathStatFunctions.i18n.php
 554+Math Stat Functions
556555 descmsg = msfunc_desc
 556+magicfile = MathStatFunctions/MathStatFunctions.i18n.magic.php
557557
558558 Media Functions
559559

Status & tagging log