r72665 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72664‎ | r72665 | r72666 >
Date:17:08, 9 September 2010
Author:roberthl
Status:deferred
Tags:
Comment:
Translate:
- Make magic-export.php backwards and forwards compatible with $aliases and $specialPageAliases respectively.
- Read aliases from the $specialPageAliases variable (will begin working after special page aliases are exported and checked in once).
- Re-enable Wikilog special page aliases support.
- Remove support for the 'aliasvar' mediawiki-define key.
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/groups/MediaWikiExtensions.php (modified) (history)
  • /trunk/extensions/Translate/groups/mediawiki-defines.txt (modified) (history)
  • /trunk/extensions/Translate/scripts/magic-export.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/magic-export.php
@@ -88,12 +88,15 @@
8989 include( $file );
9090 switch( $this->type ) {
9191 case 'special':
92 - // TODO: Rename to $specialPageAliases after the first export.
93 - if ( !isset( $aliases ) ) {
 92+ if ( isset( $aliases ) ) {
 93+ $this->messagesOld[$group->getId()] = $aliases;
 94+ unset( $aliases );
 95+ } elseif ( isset( $specialPageAliases ) ) {
 96+ $this->messagesOld[$group->getId()] = $specialPageAliases;
 97+ unset( $specialPageAliases );
 98+ } else {
9499 die( "File '$file' does not contain an aliases array.\n" );
95100 }
96 - $this->messagesOld[$group->getId()] = $aliases;
97 - unset( $aliases );
98101 break;
99102 case 'magic':
100103 if ( !isset( $magicWords ) ) {
Index: trunk/extensions/Translate/MessageGroups.php
@@ -377,7 +377,7 @@
378378 * Name of the array where all special page aliases are stored, if applicable.
379379 * Only used in class SpecialPageAliasesCM
380380 */
381 - protected $arrAlias = 'aliases';
 381+ protected $arrAlias = 'specialPageAliases';
382382
383383 protected $path = null;
384384
Index: trunk/extensions/Translate/groups/mediawiki-defines.txt
@@ -1501,9 +1501,7 @@
15021502 file = wikihiero/wikihiero.i18n.php
15031503
15041504 Wikilog
1505 -# FIXME: broken
1506 -#aliasfile = Wikilog/Wikilog.i18n.alias.php
1507 -#aliasvar = specialPageAliases
 1505+aliasfile = Wikilog/Wikilog.i18n.alias.php
15081506 magicfile = Wikilog/Wikilog.i18n.magic.php
15091507 optional = wikilog-entry-footer, wikilog-title-item-full, wikilog-feed-title
15101508 optional = wikilog-comment-footer, wikilog-simple-signature
Index: trunk/extensions/Translate/groups/MediaWikiExtensions.php
@@ -78,7 +78,6 @@
7979 case 'desc':
8080 case 'magicfile':
8181 case 'aliasfile':
82 - case 'aliasvar':
8382 $newgroup[$key] = $value;
8483 break;
8584 case 'optional':
@@ -155,7 +154,7 @@
156155 'url' => $url,
157156 );
158157
159 - $copyvars = array( 'ignored', 'optional', 'var', 'desc', 'prefix', 'mangle', 'magicfile', 'aliasfile', 'aliasvar' );
 158+ $copyvars = array( 'ignored', 'optional', 'var', 'desc', 'prefix', 'mangle', 'magicfile', 'aliasfile' );
160159 foreach ( $copyvars as $var ) {
161160 if ( isset( $g[$var] ) ) {
162161 $newgroup[$var] = $g[$var];
@@ -209,7 +208,6 @@
210209 }
211210
212211 if ( isset( $info['aliasfile'] ) ) $group->setAliasFile( $info['aliasfile'] );
213 - if ( isset( $info['aliasvar'] ) ) $group->setVariableNameAlias( $info['aliasvar'] );
214212 if ( isset( $info['magicfile'] ) ) $group->setMagicFile( $info['magicfile'] );
215213
216214 return $group;

Status & tagging log