r67041 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67040‎ | r67041 | r67042 >
Date:14:02, 29 May 2010
Author:raymond
Status:ok
Tags:
Comment:
Do not translate the extension name itself. It's proper noun as all other extensions have it
No need for function efValidatorSetup()
Tweak 'validator-desc' a bit for consistency with other desc messages
Modified paths:
  • /trunk/extensions/Validator/Validator.i18n.php (modified) (history)
  • /trunk/extensions/Validator/Validator.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/Validator.i18n.php
@@ -15,8 +15,7 @@
1616 * @author Jeroen De Dauw
1717 */
1818 $messages['en'] = array(
19 - 'validator_name' => 'Validator',
20 - 'validator-desc' => 'Validator is a MediaWiki extension that provides generic parameter handling support to other extensions',
 19+ 'validator-desc' => 'Provides generic parameter handling support to other extensions',
2120
2221 'validator_error_parameters' => 'The following {{PLURAL:$1|error has|errors have}} been detected in your syntax:',
2322 'validator_warning_parameters' => 'There {{PLURAL:$1|is an error|are errors}} in your syntax.',
@@ -41,7 +40,7 @@
4241
4342 'validator_list_omitted' => 'The {{PLURAL:$2|value|values}} $1 {{PLURAL:$2|has|have}} been omitted.',
4443
45 - // Crtiteria errors for single values & lists
 44+ // Criteria errors for single values & lists
4645 'validator_error_accepts_only' => 'Parameter $1 only accepts {{PLURAL:$3|this value|these values}}: $2.',
4746 );
4847
Index: trunk/extensions/Validator/Validator.php
@@ -37,33 +37,21 @@
3838 // Include the settings file.
3939 require_once( $egValidatorDir . 'Validator_Settings.php' );
4040
41 -// Put the initalization function into the MW extension hook.
42 -$wgExtensionFunctions[] = 'efValidatorSetup';
43 -
4441 // Register the internationalization file.
4542 $wgExtensionMessagesFiles['Validator'] = $egValidatorDir . 'Validator.i18n.php';
4643
 44+$wgExtensionCredits['other'][] = array(
 45+ 'path' => __FILE__,
 46+ 'name' => 'Validator',
 47+ 'version' => Validator_VERSION,
 48+ 'author' => array( '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]' ),
 49+ 'url' => 'http://www.mediawiki.org/wiki/Extension:Validator',
 50+ 'descriptionmsg' => 'validator-desc',
 51+);
 52+
4753 // Autoload the general classes.
48 -$wgAutoloadClasses['Validator'] = $egValidatorDir . 'Validator.class.php';
 54+$wgAutoloadClasses['Validator'] = $egValidatorDir . 'Validator.class.php';
4955 $wgAutoloadClasses['ValidatorFunctions'] = $egValidatorDir . 'Validator_Functions.php';
5056 $wgAutoloadClasses['ValidatorFormats'] = $egValidatorDir . 'Validator_Formats.php';
5157 $wgAutoloadClasses['ValidatorManager'] = $egValidatorDir . 'Validator_Manager.php';
5258 $wgAutoloadClasses['TopologicalSort'] = $egValidatorDir . 'TopologicalSort.php';
53 -
54 -/**
55 - * Initialization function for the Validator extension.
56 - */
57 -function efValidatorSetup() {
58 - global $wgExtensionCredits;
59 -
60 - wfLoadExtensionMessages( 'Validator' );
61 -
62 - $wgExtensionCredits['other'][] = array(
63 - 'path' => __FILE__,
64 - 'name' => wfMsg( 'validator_name' ),
65 - 'version' => Validator_VERSION,
66 - 'author' => array( '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]' ),
67 - 'url' => 'http://www.mediawiki.org/wiki/Extension:Validator',
68 - 'descriptionmsg' => 'validator-desc',
69 - );
70 -}

Status & tagging log