r72558 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72557‎ | r72558 | r72559 >
Date:22:27, 7 September 2010
Author:kaldari
Status:ok (Comments)
Tags:
Comment:
some clean-up of the language code ( is deprecated in favor of )
Modified paths:
  • /trunk/extensions/CentralNotice/BannerLoader.php (modified) (history)
  • /trunk/extensions/CentralNotice/SpecialNoticeTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/BannerLoader.php
@@ -128,7 +128,7 @@
129129 $oldLang = $wgLang;
130130
131131 $wgLang = Language::factory( $this->language ); // hack for {{int:...}}
132 - $out = wfMsgExt( $msg, array( 'language' => $this->language, 'parsemag' ) );
 132+ $out = wfMessage( $msg )->inLanguage( $this->language )->text();
133133
134134 // Restore global
135135 $wgLang = $oldLang;
Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php
@@ -288,7 +288,7 @@
289289 }
290290
291291 // Get user's language
292 - $wpUserLang = $wgRequest->getVal( 'wpUserLanguage' ) ? $wgRequest->getVal( 'wpUserLanguage' ) : $wgContLanguageCode;
 292+ $wpUserLang = $wgRequest->getVal( 'wpUserLanguage', $wgLanguageCode );
293293
294294 // Get current banner
295295 $currentTemplate = $wgRequest->getText( 'template' );
@@ -319,7 +319,7 @@
320320 // Show preview of banner
321321 $render = new BannerLoader();
322322 $render->siteName = 'Wikipedia';
323 - $render->language = $wgRequest->getVal( 'wpUserLanguage' );
 323+ $render->language = $wpUserLang;
324324 if ( $render->language != '' ) {
325325 $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-preview' ) . " ($render->language)",
326326 $render->getHtmlNotice( $wgRequest->getText( 'template' ) )

Follow-up revisions

RevisionCommit summaryAuthorDate
r72565forgot to update the global var declaration in r72558kaldari23:01, 7 September 2010

Comments

#Comment by Catrope (talk | contribs)   17:57, 8 September 2010

Changes to BannerLoader.php reverted in r72565.

#Comment by Kaldari (talk | contribs)   18:02, 8 September 2010

I think you mean r72563.

#Comment by Catrope (talk | contribs)   18:11, 8 September 2010

I did, yes.

#Comment by Catrope (talk | contribs)   17:59, 8 September 2010

You should get into the habit of using a text editor for writing commit summaries, or at least using single quotes instead of double quotes so references to $wgWhatever don't produce incomplete commit summaries like this one (and a number of past ones).

#Comment by Kaldari (talk | contribs)   18:00, 8 September 2010

Yep, that's a bad habit :) I'll try to make sure I don't do that in the future.

#Comment by 😂 (talk | contribs)   18:04, 8 September 2010

I've been doing this for several years and I still use -m :p

#Comment by Catrope (talk | contribs)   18:05, 8 September 2010

I personally use vim, but -m is fine as long as you take bash's mangling into account. -m is also not very nice for multi-line summaries.

Status & tagging log