r86784 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86783‎ | r86784 | r86785 >
Date:17:42, 23 April 2011
Author:ialex
Status:resolved (Comments)
Tags:
Comment:
wfMsgReal() -> wfMsg() or wfMsgNoTrans()
Modified paths:
  • /trunk/phase3/includes/Status.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Status.php
@@ -142,7 +142,7 @@
143143 $params = $this->cleanParams( $item['params'] );
144144 $xml = "<{$item['type']}>\n" .
145145 Xml::element( 'message', null, $item['message'] ) . "\n" .
146 - Xml::element( 'text', null, wfMsgReal( $item['message'], $params ) ) ."\n";
 146+ Xml::element( 'text', null, wfMsg( $item['message'], $params ) ) ."\n";
147147 foreach ( $params as $param ) {
148148 $xml .= Xml::element( 'param', null, $param );
149149 }
@@ -211,17 +211,15 @@
212212 protected function getWikiTextForError( $error ) {
213213 if ( is_array( $error ) ) {
214214 if ( isset( $error['message'] ) && isset( $error['params'] ) ) {
215 - return wfMsgReal( $error['message'],
216 - array_map( 'wfEscapeWikiText', $this->cleanParams( $error['params'] ) ),
217 - true, false, false );
 215+ return wfMsgNoTrans( $error['message'],
 216+ array_map( 'wfEscapeWikiText', $this->cleanParams( $error['params'] ) ) );
218217 } else {
219218 $message = array_shift($error);
220 - return wfMsgReal( $message,
221 - array_map( 'wfEscapeWikiText', $this->cleanParams( $error ) ),
222 - true, false, false );
 219+ return wfMsgNoTrans( $message,
 220+ array_map( 'wfEscapeWikiText', $this->cleanParams( $error ) ) );
223221 }
224222 } else {
225 - return wfMsgReal( $error, array(), true, false, false);
 223+ return wfMsgNoTrans( $error );
226224 }
227225 }
228226

Follow-up revisions

RevisionCommit summaryAuthorDate
r90117Per Brion, follow-up r86784: doucment that wfMsg() and related also accept me...ialex16:33, 15 June 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   22:17, 14 June 2011

Passing an array of params directly to wfMsg instead of passing them as function parameters seems to work (because wfMsgReplaceParams expands the first item if it's an array into a replacement of all the given params), but this isn't documented on wfMsg()'s doc comments and may or may not be something that's consistent.

Status & tagging log