r96000 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95999‎ | r96000 | r96001 >
Date:15:31, 1 September 2011
Author:siebrand
Status:ok
Tags:
Comment:
Add GENDER support for 'onlinestatus-subtitle-offline' and 'onlinestatus-subtitle-onfline'.
Modified paths:
  • /trunk/extensions/OnlineStatus/OnlineStatus.body.php (modified) (history)
  • /trunk/extensions/OnlineStatus/OnlineStatus.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatus/OnlineStatus.body.php
@@ -6,7 +6,7 @@
77 *
88 * @param mixed $title string of Title object, if it's a title, if has to be in
99 * User: of User_talk: namespace.
10 - * @return either bool or null
 10+ * @return array ( string status, string username ) or null
1111 */
1212 static function GetUserStatus( $title, $checkShowPref = false ){
1313 if( is_object( $title ) ){
@@ -34,7 +34,7 @@
3535 return null;
3636 }
3737
38 - return $user->getOption( 'online' );
 38+ return array( $user->getOption( 'online' ), $username);
3939 }
4040
4141 /**
@@ -111,9 +111,9 @@
112112 return array( 'found' => false );
113113
114114 if( empty( $raw ) ){
115 - return wfMsgNoTrans( 'onlinestatus-toggle-' . $status );
 115+ return wfMsgNoTrans( 'onlinestatus-toggle-' . $status[0] );
116116 } else {
117 - return $status;
 117+ return $status[0];
118118 }
119119 }
120120
@@ -138,7 +138,7 @@
139139 return true;
140140 }
141141
142 - $ret = wfMsgNoTrans( 'onlinestatus-toggle-' . $status );
 142+ $ret = wfMsgNoTrans( 'onlinestatus-toggle-' . $status[0] );
143143 $varCache['onlinestatus'] = $ret;
144144 } elseif( $index == 'onlinestatus_word_raw' ){
145145 $status = self::GetUserStatus( $parser->getTitle() );
@@ -147,7 +147,7 @@
148148 return true;
149149 }
150150
151 - $ret = $status;
 151+ $ret = $status[0];
152152 $varCache['onlinestatus'] = $ret;
153153 }
154154
@@ -260,7 +260,7 @@
261261
262262 // For grep. Message keys used here:
263263 // onlinestatus-subtitle-offline, onlinestatus-subtitle-onfline
264 - $out->setSubtitle( wfMsgExt( 'onlinestatus-subtitle-' . $status, array( 'parse' ) ) );
 264+ $out->setSubtitle( wfMsgExt( 'onlinestatus-subtitle-' . $status[0], array( 'parse' ), $status[1] ) );
265265
266266 return true;
267267 }
Index: trunk/extensions/OnlineStatus/OnlineStatus.i18n.php
@@ -37,6 +37,10 @@
3838 'onlinestatus-desc' => '{{desc}}',
3939 'onlinestatus-tab' => '{{Identical|Status}}',
4040 'onlinestatus-toggles-desc' => '{{Identical|Status}}',
 41+ 'onlinestatus-subtitle-offline' => 'Parameters:
 42+* $1 can be used for GENDER support.',
 43+ 'onlinestatus-subtitle-online' => 'Parameters:
 44+* $1 can be used for GENDER support.',
4145 );
4246
4347 /** Afrikaans (Afrikaans)

Status & tagging log