r14195 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14194‎ | r14195 | r14196 >
Date:10:14, 13 May 2006
Author:nikerabbit
Status:old
Tags:
Comment:
* (bug 5806) {{plural:}} support instead of "twin" MediaWiki messages
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/languages/Messages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/CategoryPage.php
@@ -154,14 +154,14 @@
155155 if( count( $children ) > 0 ) {
156156 # Showing subcategories
157157 $r .= '<h2>' . wfMsg( 'subcategories' ) . "</h2>\n";
158 - $r .= $this->formatCount( $children, 'subcategorycount' );
 158+ $r .= wfMsgExt( 'subcategorycount', array( 'parse' ), count( $children) );
159159 $r .= $this->formatList( $children, $children_start_char );
160160 }
161161
162162 # Showing articles in this category
163163 $ti = htmlspecialchars( $this->mTitle->getText() );
164164 $r .= '<h2>' . wfMsg( 'category_header', $ti ) . "</h2>\n";
165 - $r .= $this->formatCount( $articles, 'categoryarticlecount' );
 165+ $r .= wfMsgExt( 'categoryarticlecount', array( 'parse' ), count( $articles) );
166166 $r .= $this->formatList( $articles, $articles_start_char );
167167
168168 if( $wgCategoryMagicGallery && ! $ig->isEmpty() ) {
@@ -179,21 +179,6 @@
180180 }
181181
182182 /**
183 - * @param array $articles
184 - * @param string $message
185 - * @return string
186 - * @private
187 - */
188 - function formatCount( $articles, $message ) {
189 - global $wgContLang;
190 - $numart = count( $articles );
191 - if( $numart == 1 ) {
192 - # Slightly different message to avoid silly plural
193 - $message .= '1';
194 - }
195 - return wfMsg( $message, $wgContLang->formatNum( $numart ) );
196 - }
197 - /**
198183 * Format a list of articles chunked by letter, either as a
199184 * bullet list or a columnar format, depending on the length.
200185 *
Index: trunk/phase3/includes/Skin.php
@@ -514,9 +514,9 @@
515515 $pop = '</span>';
516516 $t = $embed . implode ( "{$pop} {$sep} {$embed}" , $wgOut->mCategoryLinks ) . $pop;
517517
518 - $msg = count( $wgOut->mCategoryLinks ) === 1 ? 'categories1' : 'categories';
 518+ $msg = wfMsgExt('categories', array('parsemag', 'escape'), count( $wgOut->mCategoryLinks ));
519519 $s = $this->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Categories' ),
520 - wfMsg( $msg ), 'article=' . urlencode( $wgTitle->getPrefixedDBkey() ) )
 520+ $msg, 'article=' . urlencode( $wgTitle->getPrefixedDBkey() ) )
521521 . ': ' . $t;
522522
523523 # optional 'dmoz-like' category browser. Will be shown under the list
@@ -662,7 +662,7 @@
663663 return wfMsg( $msg,
664664 $this->makeKnownLink(
665665 $wgContLang->SpecialPage( 'Undelete/' . $wgTitle->getPrefixedDBkey() ),
666 - wfMsg( 'restorelink' . ($n == 1 ? '1' : ''), $n ) ) );
 666+ wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $n ) ) );
667667 }
668668 return '';
669669 }
Index: trunk/phase3/RELEASE-NOTES
@@ -250,6 +250,7 @@
251251 * (bug 5905) Plural support for Bosnian localisation (bs)
252252 * Groups which won't hit the rate limiter now configurable with
253253 $wgRateLimitsExcludedGroups
 254+* (bug 5806) {{plural:}} support instead of "twin" MediaWiki messages
254255
255256 == Compatibility ==
256257
Index: trunk/phase3/languages/Messages.php
@@ -107,8 +107,7 @@
108108 'dec' => 'Dec',
109109 # Bits of text used by many pages:
110110 #
111 -'categories1' => 'Category',
112 -'categories' => 'Categories',
 111+'categories' => '{{PLURAL:$1|Category|Categories}}',
113112 'category' => 'category',
114113 'category_header' => 'Articles in category "$1"',
115114 'subcategories' => 'Subcategories',
@@ -255,8 +254,7 @@
256255 'hidetoc' => 'hide',
257256 'thisisdeleted' => 'View or restore $1?',
258257 'viewdeleted' => 'View $1?',
259 -'restorelink1' => 'one deleted edit',
260 -'restorelink' => '$1 deleted edits',
 258+'restorelink' => '{{PLURAL:$1|one deleted edit|$1 deleted edits}}',
261259 'feedlinks' => 'Feed:',
262260 'sitenotice' => '-', # the equivalent to wgSiteNotice
263261 'anonnotice' => '-',
@@ -1490,10 +1488,8 @@
14911489 'spamprotectiontitle' => 'Spam protection filter',
14921490 'spamprotectiontext' => 'The page you wanted to save was blocked by the spam filter. This is probably caused by a link to an external site.',
14931491 'spamprotectionmatch' => 'The following text is what triggered our spam filter: $1',
1494 -'subcategorycount' => "There are $1 subcategories to this category.",
1495 -'subcategorycount1' => "There is $1 subcategory to this category.",
1496 -'categoryarticlecount' => "There are $1 articles in this category.",
1497 -'categoryarticlecount1' => "There is $1 article in this category.",
 1492+'subcategorycount' => "There {{PLURAL:$1|is one subcategory|are $1 subcategories}} to this category.",
 1493+'categoryarticlecount' => "There {{PLURAL:$1|is one article|are $1 articles}} in this category.",
14981494 'listingcontinuesabbrev' => " cont.",
14991495 'spambot_username' => 'MediaWiki spam cleanup',
15001496 'spam_reverting' => 'Reverting to last version not containing links to $1',

Status & tagging log