r91812 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91811‎ | r91812 | r91813 >
Date:23:06, 9 July 2011
Author:bawolff
Status:resolved (Comments)
Tags:
Comment:
(bug 29563 comment 11) Use feed-atom and feed-rss messages instead of RSS and ATOM.

Personally this feels a little icky since its kind of lego-ey/resusing messages
in different contexts, but I guess its ok.

Most everywhere else in mediawiki doesn't put the type of feed in the feed description.
Modified paths:
  • /trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php
@@ -56,11 +56,21 @@
5757
5858 // Check to make sure that feed type is supported.
5959 if ( FeedUtils::checkFeedOutput( $params['feed'] ) ) {
 60+
 61+ if ( !wfEmptyMsg( 'feed-' . $params['feed'] ) ) {
 62+ // This seems a little icky since
 63+ // its re-using another message in a
 64+ // different context.
 65+ // uses feed-rss and feed-atom messages.
 66+ $feedType = wfMsgForContent( 'feed-' . $params['feed'] );
 67+ } else {
 68+ $feedType = $wgContLang->uc( $params['feed'] );
 69+ }
6070 $feed = new $wgFeedClasses[ $params['feed'] ](
6171 wfMsgExt( 'googlenewssitemap_feedtitle',
6272 array( 'parsemag', 'content' ),
6373 $wgContLang->getLanguageName( $wgLanguageCode ),
64 - $wgContLang->uc( $params['feed'] ),
 74+ $feedType,
6575 $wgLanguageCode
6676 ),
6777 wfMsgExt( 'tagline', array( 'parsemag', 'content' ) ),

Sign-offs

UserFlagDate
Mjbmrinspected09:37, 12 July 2011 (struck 09:39, 12 July 2011)
Mjbmrtested09:37, 12 July 2011 (struck 09:39, 12 July 2011)

Follow-up revisions

RevisionCommit summaryAuthorDate
r95178(follow-up r91812) change to wfMessage per Roan's suggestion....bawolff20:22, 21 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90740Export special page alias for 'fa' for bug 29563raymond21:54, 24 June 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   18:51, 9 August 2011

What happens if the user language message exists but not the content one (in regards to wfEmptyMsg( 'feed-' . $params['feed'] )?

#Comment by Catrope (talk | contribs)   08:07, 20 August 2011

That problem could be solved with $msg = wfMessage( 'foo' )->inContentLanguage(); if ( $msg->exists() ) { ... } , right?

#Comment by Bawolff (talk | contribs)   20:24, 21 August 2011

Looks like that works. Changed in r95178

Status & tagging log