r110232 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110231‎ | r110232 | r110233 >
Date:11:42, 29 January 2012
Author:maxsem
Status:reverted (Comments)
Tags:
Comment:
Revert r110161 and remove the empty configuration messages instead - let automatic fallbacks do what they've been designed for
Modified paths:
  • /trunk/extensions/FeaturedFeeds/FeaturedFeeds.body.php (modified) (history)
  • /trunk/extensions/FeaturedFeeds/FeaturedFeeds.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FeaturedFeeds/FeaturedFeeds.body.php
@@ -298,7 +298,7 @@
299299 }
300300
301301 public function init() {
302 - global $wgLanguageCode, $wgContLang;
 302+ global $wgContLang;
303303 if ( $this->title !== false ) {
304304 return;
305305 }
@@ -313,14 +313,6 @@
314314 }
315315 $pageMsg = $this->msg( $this->options['page'] )->params( $this->language->getCode() );
316316 if ( $pageMsg->isDisabled() ) {
317 - // fall back manually, messages can be existent but empty
318 - if ( $this->language->getCode() != $wgLanguageCode ) {
319 - $pageMsg = wfMessage( $this->options['page'] )
320 - ->params( $this->language->getCode() )
321 - ->inContentLanguage();
322 - }
323 - }
324 - if ( $pageMsg->isDisabled() ) {
325317 return;
326318 }
327319 $this->page = $pageMsg->plain();
Index: trunk/extensions/FeaturedFeeds/FeaturedFeeds.i18n.php
@@ -20,42 +20,36 @@
2121 'ffeed-invalid-timestamp' => 'Invalid feed timestamp',
2222
2323 # Featured Article
24 - 'ffeed-featured-page' => '', # do not localise
2524 'ffeed-featured-title' => '{{SITENAME}} featured articles feed',
2625 'ffeed-featured-short-title' => 'Featured articles',
2726 'ffeed-featured-desc' => 'Best articles {{SITENAME}} has to offer',
2827 'ffeed-featured-entry' => '{{LOCALMONTHNAME}} {{LOCALDAY}} {{SITENAME}} featured article',
2928
3029 # On this day...
31 - 'ffeed-onthisday-page' => '', # do not localise
3230 'ffeed-onthisday-title' => '{{SITENAME}} "On this day..." feed',
3331 'ffeed-onthisday-short-title' => 'On this day...',
3432 'ffeed-onthisday-desc' => 'Historical events on this day',
3533 'ffeed-onthisday-entry' => 'On this day: {{LOCALMONTHNAME}} {{LOCALDAY}}',
3634
3735 # Did You Know?
38 - 'ffeed-dyk-page' => '', # do not localise
3936 'ffeed-dyk-title' => '{{SITENAME}} "Did You Know?" feed',
4037 'ffeed-dyk-short-title' => 'Did you know?',
4138 'ffeed-dyk-desc' => "From {{SITENAME}}'s newest content",
4239 'ffeed-dyk-entry' => 'Did you know?: {{LOCALMONTHNAME}} {{LOCALDAY}}',
4340
4441 // Media Of The Day
45 - 'ffeed-motd-page' => '', # do not localise
4642 'ffeed-motd-title' => '{{SITENAME}} media of the day feed',
4743 'ffeed-motd-short-title' => 'Media of the day',
4844 'ffeed-motd-desc' => 'Some of the finest media on {{SITENAME}}',
4945 'ffeed-motd-entry' => '{{SITENAME}} media of the day for {{LOCALMONTHNAME}} {{LOCALDAY}}',
5046
5147 # Picture Of The Day
52 - 'ffeed-potd-page' => '', # do not localise
5348 'ffeed-potd-title' => '{{SITENAME}} picture of the day feed',
5449 'ffeed-potd-short-title' => 'Picture of the day',
5550 'ffeed-potd-desc' => 'Some of the finest images on {{SITENAME}}',
5651 'ffeed-potd-entry' => '{{SITENAME}} picture of the day for {{LOCALMONTHNAME}} {{LOCALDAY}}',
5752
5853 # Quote of the Day
59 - 'ffeed-qotd-page' => '', # do not localise
6054 'ffeed-qotd-title' => '{{SITENAME}} quote of the day feed',
6155 'ffeed-qotd-short-title' => 'Quote of the day',
6256 'ffeed-qotd-desc' => 'Some of the finest quotes on {{SITENAME}}',

Follow-up revisions

RevisionCommit summaryAuthorDate
r110479Revert r110232 per objections from i18n peoplemaxsem14:50, 1 February 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r110161Fall back to content language manually, these messages exist locally, but are...maxsem20:20, 27 January 2012

Comments

#Comment by Raymond (talk | contribs)   16:01, 29 January 2012

I think that empty configuration messages should stay in the i18n file. This way they are shown in Special:AllMessages: https://commons.wikimedia.org/w/index.php?title=Special%3AAllMessages&prefix=ffeed&filter=all&lang=en&limit=250 which is helpful to identify the usage of messages.

I recommend revert of the removal.

#Comment by Liangent (talk | contribs)   05:03, 31 January 2012

Those message names are not pre-defined in the extension but defined in LocalSettings.php. The wiki admin should know what he did in LocalSettings.php.

#Comment by Raymond (talk | contribs)   07:54, 31 January 2012

LocalSettings.php? For WMF cluster I do not see such definition in http://noc.wikimedia.org/conf/highlight.php?file=CommonSettings.php

The message content is defined on-wiki in the MediaWiki namespace, isn't it? As pointed out in my first comment the message keys won't show up on Special:Allmessage if not defined in the i18n file. And that would be bad :-(

#Comment by Liangent (talk | contribs)   08:06, 31 January 2012
#Comment by Raymond (talk | contribs)   08:09, 31 January 2012

I know the page, I have setup the feed for dewiki. on-wiki in the MediaWiki namespace. Where else? https://de.wikipedia.org/w/index.php?title=Spezial%3AMediaWiki-Systemnachrichten&prefix=ffeed&filter=all&lang=de&limit=200

#Comment by Liangent (talk | contribs)   08:13, 31 January 2012

Without that doc page how can you know MediaWiki:Ffeed-dyk-page is used for &feed=dyk? A simple on-wiki message list without doc is useless.

#Comment by Raymond (talk | contribs)   08:16, 31 January 2012

You are right. But I do not want miss these messages from Special:AllMessages. Makes life easier for site admin for searching the right message key in case of changes in the wiki itself.

#Comment by Liangent (talk | contribs)   08:08, 31 January 2012

By the way why don't we put WMF-specific definitions in normal WMF configuration files but a file in this non-WMF-specific extension itself?

#Comment by Raymond (talk | contribs)   08:11, 31 January 2012

I see what you mean: FeatuedFeedsWMF.php... hmmmm

#Comment by MaxSem (talk | contribs)   08:15, 31 January 2012

Because I don't have access to WMF config files like flaggedrevs.php, and messages used in FeaturedFeedsWMF.php are present in language files anyway.

Status & tagging log