Index: trunk/phase3/includes/CategoryPage.php |
— | — | @@ -154,14 +154,14 @@ |
155 | 155 | if( count( $children ) > 0 ) { |
156 | 156 | # Showing subcategories |
157 | 157 | $r .= '<h2>' . wfMsg( 'subcategories' ) . "</h2>\n"; |
158 | | - $r .= $this->formatCount( $children, 'subcategorycount' ); |
| 158 | + $r .= wfMsgExt( 'subcategorycount', array( 'parse' ), count( $children) ); |
159 | 159 | $r .= $this->formatList( $children, $children_start_char ); |
160 | 160 | } |
161 | 161 | |
162 | 162 | # Showing articles in this category |
163 | 163 | $ti = htmlspecialchars( $this->mTitle->getText() ); |
164 | 164 | $r .= '<h2>' . wfMsg( 'category_header', $ti ) . "</h2>\n"; |
165 | | - $r .= $this->formatCount( $articles, 'categoryarticlecount' ); |
| 165 | + $r .= wfMsgExt( 'categoryarticlecount', array( 'parse' ), count( $articles) ); |
166 | 166 | $r .= $this->formatList( $articles, $articles_start_char ); |
167 | 167 | |
168 | 168 | if( $wgCategoryMagicGallery && ! $ig->isEmpty() ) { |
— | — | @@ -179,21 +179,6 @@ |
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
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 | | - /** |
198 | 183 | * Format a list of articles chunked by letter, either as a |
199 | 184 | * bullet list or a columnar format, depending on the length. |
200 | 185 | * |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -514,9 +514,9 @@ |
515 | 515 | $pop = '</span>'; |
516 | 516 | $t = $embed . implode ( "{$pop} {$sep} {$embed}" , $wgOut->mCategoryLinks ) . $pop; |
517 | 517 | |
518 | | - $msg = count( $wgOut->mCategoryLinks ) === 1 ? 'categories1' : 'categories'; |
| 518 | + $msg = wfMsgExt('categories', array('parsemag', 'escape'), count( $wgOut->mCategoryLinks )); |
519 | 519 | $s = $this->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Categories' ), |
520 | | - wfMsg( $msg ), 'article=' . urlencode( $wgTitle->getPrefixedDBkey() ) ) |
| 520 | + $msg, 'article=' . urlencode( $wgTitle->getPrefixedDBkey() ) ) |
521 | 521 | . ': ' . $t; |
522 | 522 | |
523 | 523 | # optional 'dmoz-like' category browser. Will be shown under the list |
— | — | @@ -662,7 +662,7 @@ |
663 | 663 | return wfMsg( $msg, |
664 | 664 | $this->makeKnownLink( |
665 | 665 | $wgContLang->SpecialPage( 'Undelete/' . $wgTitle->getPrefixedDBkey() ), |
666 | | - wfMsg( 'restorelink' . ($n == 1 ? '1' : ''), $n ) ) ); |
| 666 | + wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $n ) ) ); |
667 | 667 | } |
668 | 668 | return ''; |
669 | 669 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -250,6 +250,7 @@ |
251 | 251 | * (bug 5905) Plural support for Bosnian localisation (bs) |
252 | 252 | * Groups which won't hit the rate limiter now configurable with |
253 | 253 | $wgRateLimitsExcludedGroups |
| 254 | +* (bug 5806) {{plural:}} support instead of "twin" MediaWiki messages |
254 | 255 | |
255 | 256 | == Compatibility == |
256 | 257 | |
Index: trunk/phase3/languages/Messages.php |
— | — | @@ -107,8 +107,7 @@ |
108 | 108 | 'dec' => 'Dec', |
109 | 109 | # Bits of text used by many pages: |
110 | 110 | # |
111 | | -'categories1' => 'Category', |
112 | | -'categories' => 'Categories', |
| 111 | +'categories' => '{{PLURAL:$1|Category|Categories}}', |
113 | 112 | 'category' => 'category', |
114 | 113 | 'category_header' => 'Articles in category "$1"', |
115 | 114 | 'subcategories' => 'Subcategories', |
— | — | @@ -255,8 +254,7 @@ |
256 | 255 | 'hidetoc' => 'hide', |
257 | 256 | 'thisisdeleted' => 'View or restore $1?', |
258 | 257 | 'viewdeleted' => 'View $1?', |
259 | | -'restorelink1' => 'one deleted edit', |
260 | | -'restorelink' => '$1 deleted edits', |
| 258 | +'restorelink' => '{{PLURAL:$1|one deleted edit|$1 deleted edits}}', |
261 | 259 | 'feedlinks' => 'Feed:', |
262 | 260 | 'sitenotice' => '-', # the equivalent to wgSiteNotice |
263 | 261 | 'anonnotice' => '-', |
— | — | @@ -1490,10 +1488,8 @@ |
1491 | 1489 | 'spamprotectiontitle' => 'Spam protection filter', |
1492 | 1490 | 'spamprotectiontext' => 'The page you wanted to save was blocked by the spam filter. This is probably caused by a link to an external site.', |
1493 | 1491 | '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.", |
1498 | 1494 | 'listingcontinuesabbrev' => " cont.", |
1499 | 1495 | 'spambot_username' => 'MediaWiki spam cleanup', |
1500 | 1496 | 'spam_reverting' => 'Reverting to last version not containing links to $1', |