r96257 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96256‎ | r96257 | r96258 >
Date:21:19, 4 September 2011
Author:robin
Status:resolved
Tags:
Comment:
Correctly parse interface messages as such, so it doesn't get converted according to the content language (like r94395/r94279)
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -228,11 +228,13 @@
229229 $undotext = $this->mArticle->getUndoText( $undorev, $oldrev );
230230 if ( $undotext === false ) {
231231 # Warn the user that something went wrong
232 - $this->editFormPageTop .= $wgOut->parse( '<div class="error mw-undo-failure">' . wfMsgNoTrans( 'undo-failure' ) . '</div>' );
 232+ $this->editFormPageTop .= $wgOut->parse( '<div class="error mw-undo-failure">' .
 233+ wfMsgNoTrans( 'undo-failure' ) . '</div>', true, /* interface */true );
233234 } else {
234235 $text = $undotext;
235236 # Inform the user of our success and set an automatic edit summary
236 - $this->editFormPageTop .= $wgOut->parse( '<div class="mw-undo-success">' . wfMsgNoTrans( 'undo-success' ) . '</div>' );
 237+ $this->editFormPageTop .= $wgOut->parse( '<div class="mw-undo-success">' .
 238+ wfMsgNoTrans( 'undo-success' ) . '</div>', true, /* interface */true );
237239 $firstrev = $oldrev->getNext();
238240 # If we just undid one rev, use an autosummary
239241 if ( $firstrev->mId == $undo ) {
@@ -245,7 +247,8 @@
246248 // Failed basic sanity checks.
247249 // Older revisions may have been removed since the link
248250 // was created, or we may simply have got bogus input.
249 - $this->editFormPageTop .= $wgOut->parse( '<div class="error mw-undo-norev">' . wfMsgNoTrans( 'undo-norev' ) . '</div>' );
 251+ $this->editFormPageTop .= $wgOut->parse( '<div class="error mw-undo-norev">' .
 252+ wfMsgNoTrans( 'undo-norev' ) . '</div>'true, /* interface */true );
250253 }
251254 } elseif ( $section != '' ) {
252255 if ( $section == 'new' ) {
@@ -2080,7 +2083,7 @@
20812084 // string, which happens when you initially edit
20822085 // a category page, due to automatic preview-on-open.
20832086 $parsedNote = $wgOut->parse( "<div class='previewnote'>" .
2084 - wfMsg( 'session_fail_preview_html' ) . "</div>" );
 2087+ wfMsg( 'session_fail_preview_html' ) . "</div>", true, /* interface */true );
20852088 }
20862089 wfProfileOut( __METHOD__ );
20872090 return $parsedNote;
@@ -2154,7 +2157,7 @@
21552158
21562159 $previewhead = "<div class='previewnote'>\n" .
21572160 '<h2 id="mw-previewheader">' . htmlspecialchars( wfMsg( 'preview' ) ) . "</h2>" .
2158 - $wgOut->parse( $note ) . $conflict . "</div>\n";
 2161+ $wgOut->parse( $note, true, /* interface */true ) . $conflict . "</div>\n";
21592162
21602163 $pageLang = $this->mTitle->getPageLanguage();
21612164 $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
Index: trunk/phase3/includes/OutputPage.php
@@ -1459,7 +1459,8 @@
14601460 * @param $linestart Boolean: is this the start of a line?
14611461 * @param $interface Boolean: use interface language ($wgLang instead of
14621462 * $wgContLang) while parsing language sensitive magic
1463 - * words like GRAMMAR and PLURAL
 1463+ * words like GRAMMAR and PLURAL. This also disables
 1464+ * LanguageConverter.
14641465 * @param $language Language object: target language object, will override
14651466 * $interface
14661467 * @return String: HTML

Follow-up revisions

RevisionCommit summaryAuthorDate
r96258whoops, fix r96257robin21:22, 4 September 2011
r96737Correctly parse interface messages as such, so it doesn't get converted accor...robin20:05, 10 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94279* CategoryPage.php: fix the "category-empty" message per comment on r91518, i...robin19:58, 11 August 2011
r94395Mark wfMsgWikiHtml() as an interface message so it doesn't get converted acco...robin23:14, 12 August 2011

Status & tagging log