From: Antoine Musso Date: Thu, 12 Aug 2004 13:58:54 +0000 (+0000) Subject: Fix source forge bug #1007149. Wrong plural when listing categories and subcategories... X-Git-Tag: 1.5.0alpha1~2398 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=4054b8773cc727ea9388ae9b16e77e5ea3ca2ec2;p=lhc%2Fweb%2Fwiklou.git Fix source forge bug #1007149. Wrong plural when listing categories and subcategories. Added two new messages in language.php --- diff --git a/includes/Parser.php b/includes/Parser.php index 53b64898be..7aac8e7bf8 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -513,8 +513,16 @@ class Parser if ( count ( $children ) > 0 ) { # Showing subcategories - $r .= '

' . wfMsg( 'subcategories' ) . "

\n" - . wfMsg( 'subcategorycount', count( $children ) ); + $r .= '

' . wfMsg( 'subcategories' ) . "

\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 .= ''; } } # END of if ( count($children) > 0 ) + + $r .= '

' . wfMsg( 'category_header', $ti ) . "

\n"; - $r .= '

' . wfMsg( 'category_header', $ti ) . "

\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) { diff --git a/languages/Language.php b/languages/Language.php index 06ecb32e95..a613d8de3d 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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