r45136 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45135‎ | r45136 | r45137 >
Date:20:51, 28 December 2008
Author:siebrand
Status:deferred
Tags:
Comment:
* Improve i18n
* added documentation for 2 messages
* change ?/: to if/else for readability
Modified paths:
  • /trunk/extensions/uniwiki/FormatChanges/FormatChanges.i18n.php (modified) (history)
  • /trunk/extensions/uniwiki/FormatChanges/FormatChanges.php (modified) (history)

Diff [purge]

Index: trunk/extensions/uniwiki/FormatChanges/FormatChanges.i18n.php
@@ -12,8 +12,8 @@
1313 $messages['en'] = array(
1414 'formatchanges-desc' => 'Reformats the [[Special:RecentChanges|recent changes]]',
1515 'formatchanges-anonymous' => 'Anonymous',
16 - 'formatchanges-createdby' => 'created by',
17 - 'formatchanges-editedby' => 'edited by',
 16+ 'formatchanges-createdby' => '$1 - created by $2 ($3)',
 17+ 'formatchanges-editedby' => '$1 - edited by $2 ($3)',
1818 );
1919
2020 /** Message documentation (Message documentation)
@@ -21,6 +21,12 @@
2222 */
2323 $messages['qqq'] = array(
2424 'formatchanges-desc' => 'Short description of the extension, shown in [[Special:Version]]. Do not translate or change links.',
 25+ 'formatchanges-createdby' => '* $1 is a link to a page with the page title as link description
 26+* $2 is a link to a user page with the user name as link description
 27+* $3 is the time at which the page was created',
 28+ 'formatchanges-editedby' => '* $1 is a link to a page with the page title as link description
 29+* $2 is a link to a user page with the user name as link description
 30+* $3 is the time at which the page was changed',
2531 );
2632
2733 /** Arabic (العربية)
Index: trunk/extensions/uniwiki/FormatChanges/FormatChanges.php
@@ -71,8 +71,12 @@
7272 $user_link = ( $rc_user > 0 ) ? $this->skin->userLink( $rc_user, $rc_user_text ) : wfMsg( 'formatchanges-anonymous' );
7373 }
7474 $timestamp = $wgLang->time( $rc->mAttribs['rc_timestamp'], true, true );
75 - $action = ( $rc_type == RC_NEW ) ? wfMsg( 'formatchanges-createdby' ) : wfMsg( 'formatchanges-editedby' );
76 - $line .= $page_link . " - " . $action . " " . $user_link . " (" . $timestamp . ")";
 75+
 76+ if ( $rc_type == RC_NEW ) {
 77+ $line = wfMsgHtml( 'formatchanges-createdby', $page_link, $user_link, $timestamp );
 78+ } else {
 79+ $line = wfMsgHtml( 'formatchanges-editedby', $page_link, $user_link, $timestamp );
 80+ }
7781 $line .= "</li>";
7882 }
7983

Status & tagging log