r110161 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110160‎ | r110161 | r110162 >
Date:20:20, 27 January 2012
Author:maxsem
Status:reverted
Tags:
Comment:
Fall back to content language manually, these messages exist locally, but are empty if not customized
Modified paths:
  • /trunk/extensions/FeaturedFeeds/FeaturedFeeds.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FeaturedFeeds/FeaturedFeeds.body.php
@@ -4,7 +4,7 @@
55 /**
66 * Returns the list of feeds
77 *
8 - * @param $langCode string||bool Code of language to use or false if default
 8+ * @param $langCode string|bool Code of language to use or false if default
99 * @return array Feeds in format of 'name' => array of FeedItem
1010 */
1111 public static function getFeeds( $langCode ) {
@@ -270,6 +270,7 @@
271271 }
272272
273273 public function init() {
 274+ global $wgLanguageCode;
274275 if ( $this->title !== false ) {
275276 return;
276277 }
@@ -278,6 +279,14 @@
279280 $this->description = $this->msg( $this->options['description'] )->text();
280281 $pageMsg = $this->msg( $this->options['page'] )->params( $this->language->getCode() );
281282 if ( $pageMsg->isDisabled() ) {
 283+ // fall back manually, messages can be existent but empty
 284+ if ( $this->language->getCode() != $wgLanguageCode ) {
 285+ $pageMsg = wfMessage( $this->options['page'] )
 286+ ->params( $this->language->getCode() )
 287+ ->inContentLanguage();
 288+ }
 289+ }
 290+ if ( $pageMsg->isDisabled() ) {
282291 return;
283292 }
284293 $this->page = $pageMsg->plain();

Follow-up revisions

RevisionCommit summaryAuthorDate
r110232Revert r110161 and remove the empty configuration messages instead - let auto...maxsem11:42, 29 January 2012

Status & tagging log