r111780 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111779‎ | r111780 | r111781 >
Date:19:50, 17 February 2012
Author:maxsem
Status:ok
Tags:
Comment:
Use localised dates in feed entry titles
Modified paths:
  • /trunk/extensions/FeaturedFeeds/FeaturedFeeds.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FeaturedFeeds/FeaturedFeeds.body.php
@@ -250,6 +250,7 @@
251251 private $items = false;
252252 private $page = false;
253253 private $entryName;
 254+ private $titleForParse;
254255
255256 public $title = false;
256257 public $shortTitle;
@@ -373,8 +374,13 @@
374375 $this->name . '/' . wfTimestamp( TS_MW, $date ) . '/' . $this->language->getCode()
375376 )->getFullURL();
376377
 378+ if ( !isset( $this->titleForParse ) ) {
 379+ // parsing with such title makes stuff like {{CURRENTMONTH}} localised
 380+ $this->titleForParse = Title::newFromText( 'MediaWiki:Dummy/' . $this->language->getCode() );
 381+ }
 382+
377383 return new FeaturedFeedItem(
378 - self::$parser->transformMsg( $this->entryName, self::$parserOptions ),
 384+ self::$parser->transformMsg( $this->entryName, self::$parserOptions, $this->titleForParse ),
379385 wfExpandUrl( $url ),
380386 $text,
381387 $date

Follow-up revisions

RevisionCommit summaryAuthorDate
r112023MFT r111698, r111780, r111947reedy17:01, 21 February 2012
r112029MFT r111698, r111780 to attempt to shut up some of the warningsreedy17:34, 21 February 2012

Status & tagging log