r42668 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42667‎ | r42668 | r42669 >
Date:18:44, 27 October 2008
Author:minuteelectron
Status:old
Tags:
Comment:
* Use a message for the username.
Modified paths:
  • /trunk/extensions/Babel/Babel.i18n.php (modified) (history)
  • /trunk/extensions/Babel/Babel.php (modified) (history)
  • /trunk/extensions/Babel/BabelAutoCreate.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Babel/Babel.i18n.php
@@ -20,6 +20,7 @@
2121 'babel-autocreate-reason' => 'Automatically creating Babel category page.',
2222 'babel-autocreate-text-levels' => 'Users in this category indicate they have skill level $1 for language $2.',
2323 'babel-autocreate-text-main' => 'Users in this category indicate they have knowlege of language $1.',
 24+ 'babel-autocreate-user' => 'Babel AutoCreate',
2425
2526 'babel-directionality' => 'ltr', # Optional.
2627
Index: trunk/extensions/Babel/Babel.php
@@ -51,7 +51,6 @@
5252 $wgBabelUseLevelZeroCategory = false;
5353 $wgBabelUseSimpleCategories = false;
5454 $wgBabelUseMainCategories = true;
55 -$wgBabelAutoCreateUsername = 'Babel AutoCreate';
5655 $wgLanguageCodesFiles = array();
5756 $wgLanguageCodesFiles[ 'ISO_639_1' ] = dirname( __FILE__ ) . '/codes/ISO_639_1.php';
5857 $wgLanguageCodesFiles[ 'ISO_639_3' ] = dirname( __FILE__ ) . '/codes/ISO_639_3.php';
\ No newline at end of file
Index: trunk/extensions/Babel/BabelAutoCreate.class.php
@@ -3,10 +3,9 @@
44 class BabelAutoCreate {
55 static $user = false;
66 public static function RegisterAbort( User $user, &$message ) {
7 - global $wgBabelAutoCreateUsername;
87 wfLoadExtensionMessages( 'Babel' );
98 $message = wfMsg( 'babel-autocreate-abort' );
10 - return !( $user->getName() === $wgBabelAutoCreateUsername );
 9+ return !( $user->getName() === wfMsgForContent( 'babel-autocreate-user' ) );
1110 }
1211 public static function create( $category, $language, $level = null ) {
1312 global $wgUser;
@@ -24,9 +23,8 @@
2524 $wgUser = $olduser;
2625 }
2726 public static function user() {
28 - global $wgBabelAutoCreateUsername;
2927 if( !self::$user ) {
30 - self::$user = User::newFromName( $wgBabelAutoCreateUsername, false );
 28+ self::$user = User::newFromName( wfMsgForContent( 'babel-autocreate-user' ), false );
3129 if( !self::$user->isLoggedIn() ) self::$user->addToDatabase();
3230 }
3331 return self::$user;

Status & tagging log