Fix source forge bug #1007149. Wrong plural when listing categories and subcategories...
authorAntoine Musso <hashar@users.mediawiki.org>
Thu, 12 Aug 2004 13:58:54 +0000 (13:58 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Thu, 12 Aug 2004 13:58:54 +0000 (13:58 +0000)
includes/Parser.php
languages/Language.php

index 53b6489..7aac8e7 100644 (file)
@@ -513,8 +513,16 @@ class Parser
                if ( count ( $children ) > 0 )
                {
                        # Showing subcategories
-                       $r .= '<h2>' . wfMsg( 'subcategories' ) . "</h2>\n"
-                               . wfMsg( 'subcategorycount', count( $children ) );
+                       $r .= '<h2>' . wfMsg( 'subcategories' ) . "</h2>\n";
+                       
+                       $numchild = count( $children );
+                       if($numchild == 1) {
+                               $r .= wfMsg( 'subcategorycount1', 1 );
+                       } else {
+                               $r .= wfMsg( 'subcategorycount' , $numchild );
+                       }
+                       unset($numchild);
+                                               
                        if ( count ( $children ) > 6 ) {
 
                                // divide list into three equal chunks
@@ -569,9 +577,16 @@ class Parser
                                $r .= '</ul>';
                        }
                } # END of if ( count($children) > 0 )
+               
+               $r .= '<h2>' . wfMsg( 'category_header', $ti ) . "</h2>\n";
 
-               $r .= '<h2>' . wfMsg( 'category_header', $ti ) . "</h2>\n" .
-                       wfMsg( 'categoryarticlecount', count( $articles ) );
+               $numart = count( $articles );
+               if($numart == 1) {
+                       $r .= wfMsg( 'categoryarticlecount1', 1 );
+               } else {
+                       $r .= wfMsg( 'categoryarticlecount' , $numart );
+               }
+               unset($numart);
 
                # Showing articles in this category
                if ( count ( $articles ) > 6) {
index 06ecb32..a613d8d 100644 (file)
@@ -1416,7 +1416,9 @@ amusement.',
 
 You might want to check the following regular expression for patterns that are currently blocked:',
 'subcategorycount' => "There are $1 subcategories to this category.",
+'subcategorycount1' => "There is $1 subcategorie to this category.",
 'categoryarticlecount' => "There are $1 articles in this category.",
+'categoryarticlecount1' => "There is $1 article in this category.",
 'usenewcategorypage' => "1\n\nSet first character to \"0\" to disable the new category page layout.",
 
 # Info page