r82463 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82462‎ | r82463 | r82464 >
Date:16:40, 19 February 2011
Author:jeroendedauw
Status:deferred (Comments)
Tags:
Comment:
Added i18n file and did some cleanup
Modified paths:
  • /trunk/extensions/ArrayExtension/ArrayExtension.i18n.magic.php (modified) (history)
  • /trunk/extensions/ArrayExtension/ArrayExtension.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArrayExtension/ArrayExtension.php
@@ -1,16 +1,29 @@
22 <?php
3 -/*
4 - Defines a subset of parser functions that operate with arrays.
5 - verion: 1.3.2
6 - authors: Li Ding (lidingpku@gmail.com) and Jie Bao, Daniel Werner (since version 1.3)
7 - update: 24th January 2011
83
9 - homepage: http://www.mediawiki.org/wiki/Extension:ArrayExtension
 4+/**
 5+ * Initialization file for the ArrayExtension extension.
 6+ *
 7+ * Documentation: http://www.mediawiki.org/wiki/Extension:ArrayExtension
 8+ * Support http://www.mediawiki.org/wiki/Extension_talk:ArrayExtension
 9+ * Source code: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/ArrayExtension
 10+ *
 11+ * @file ArrayExtension.php
 12+ * @ingroup ArrayExtension
 13+ *
 14+ * @licence MIT License
 15+ *
 16+ * @author Li Ding (lidingpku@gmail.com)
 17+ * @author Jie Bao
 18+ * @author Daniel Werner (since version 1.3)
 19+ */
1020
 21+/**
 22+ * This documenation group collects source code files belonging to ArrayExtension.
 23+ *
 24+ * @defgroup ArrayExtension ArrayExtension
 25+ */
1126
12 -ToDo:
13 -=====
14 -
 27+/* TODO:
1528 - add experimental table (2 dimension array) data structure
1629 * table = header, row+ (1,1....)
1730 * sort_table_by_header (header)
@@ -23,7 +36,6 @@
2437 * get_table_header () to an array
2538 * get_total_row
2639 * get_total_col
27 -
2840 */
2941
3042 if ( ! defined( 'MEDIAWIKI' ) ) {
@@ -36,9 +48,11 @@
3749 'name' => 'ArrayExtension',
3850 'url' => 'http://www.mediawiki.org/wiki/Extension:ArrayExtension',
3951 'author' => array ( 'Li Ding', 'Jie Bao', 'Daniel Werner' ),
40 - 'description' => 'Store and compute named arrays',
 52+ 'descriptionmsg' => 'arrayext-desc',
4153 'version' => ArrayExtension::VERSION,
 54+ 'path' => __FILE__
4255 );
 56+$wgExtensionMessagesFiles['ArrayExtension'] = dirname( __FILE__ ) . '/ArrayExtension.i18n.php';
4357
4458 $wgHooks['LanguageGetMagic'][] = 'efArrayExtensionLanguageGetMagic';
4559
@@ -48,7 +62,7 @@
4963 */
5064 class ArrayExtension {
5165
52 - const VERSION = '1.3.3';
 66+ const VERSION = '1.3.4 alpha';
5367
5468 var $mArrayExtension = array();
5569
@@ -173,7 +187,7 @@
174188 }
175189
176190 function arrayprintObj( &$parser, $frame, $args ) {
177 - // Set variables
 191+ // Set variables
178192 $arrayid = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : '';
179193 $delimiter = isset( $args[1] ) ? trim( $frame->expand( $args[1] ) ) : ', ';
180194 $search = isset( $args[2] ) ? trim( $frame->expand( $args[2], PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES ) ) : '@@@@';
@@ -764,7 +778,10 @@
765779
766780 function efArrayExtensionLanguageGetMagic( &$magicWords, $langCode ) {
767781 require_once( dirname( __FILE__ ) . '/ArrayExtension.i18n.magic.php' );
768 - foreach ( efArrayExtensionWords( $langCode ) as $word => $trans )
769 - $magicWords[$word] = $trans;
 782+
 783+ foreach ( efArrayExtensionWords( $langCode ) as $word => $trans ) {
 784+ $magicWords[$word] = $trans;
 785+ }
 786+
770787 return true;
771 -}
\ No newline at end of file
 788+}
Index: trunk/extensions/ArrayExtension/ArrayExtension.i18n.magic.php
@@ -1,9 +1,19 @@
22 <?php
33
44 /**
 5+ * Internationalization file for magic words in the ArrayExtension extension.
 6+ *
 7+ * @file ArrayExtension.i18n.magic.php
 8+ * @ingroup ArrayExtension
 9+ *
 10+ * @licence MIT License
 11+ */
 12+
 13+/**
514 * Get translated magic words, if available
615 *
716 * @param string $lang Language code
 17+ *
818 * @return array
919 */
1020 function efArrayExtensionWords( $lang ) {
@@ -38,4 +48,4 @@
3949 return ( $lang == 'en' || !isset( $words[$lang] ) )
4050 ? $words['en']
4151 : array_merge( $words['en'], $words[$lang] );
42 -}
\ No newline at end of file
 52+}

Comments

#Comment by Reach Out to the Truth (talk | contribs)   17:43, 22 February 2011

It seems you forgot to commit ArrayExtension.i18n.php.

Status & tagging log