* Pluralform => Plural
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Tue, 6 Sep 2005 17:02:19 +0000 (17:02 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Tue, 6 Sep 2005 17:02:19 +0000 (17:02 +0000)
includes/MagicWord.php
includes/Parser.php
languages/Language.php
languages/LanguageRu.php

index db34f25..7d2b8f5 100644 (file)
@@ -56,7 +56,7 @@ define('MAG_SCRIPTPATH',              41);
 define('MAG_SERVERNAME',               42);
 define('MAG_NUMBEROFFILES',            43);
 define('MAG_IMG_MANUALTHUMB',          44);
-define('MAG_PLURALFORM',               45);
+define('MAG_PLURAL',                   45);
 
 $wgVariableIDs = array(
        MAG_CURRENTMONTH,
index 1914613..df27432 100644 (file)
@@ -2174,12 +2174,12 @@ class Parser
                        }
                }
 
-               # PLURALFORM
+               # PLURAL
                if ( !$found && $argc >= 2 ) {
-                       $mwPluralForm =& MagicWord::get( MAG_PLURALFORM );
+                       $mwPluralForm =& MagicWord::get( MAG_PLURAL );
                        if ( $mwPluralForm->matchStartAndRemove( $part1 ) ) {
                                if ($argc==2) {$args[2]=$args[1];}
-                               $text = $linestart . $wgContLang->convertPluralForm( $part1, $args[0], $args[1], $args[2]);
+                               $text = $linestart . $wgContLang->convertPlural( $part1, $args[0], $args[1], $args[2]);
                                $found = true;
                        }
                }
index 795d801..b39f076 100644 (file)
@@ -233,7 +233,7 @@ $wgLanguageNamesEn =& $wgLanguageNames;
        MAG_CURRENTWEEK          => array( 1,    'CURRENTWEEK'            ),
        MAG_CURRENTDOW           => array( 1,    'CURRENTDOW'             ),
        MAG_REVISIONID           => array( 1,    'REVISIONID'             ),
-       MAG_PLURALFORM           => array( 0,    'PLURALFORM:'            ),
+       MAG_PLURAL               => array( 0,    'PLURAL:'                ),
 );
 
 #-------------------------------------------------------------------
@@ -2789,10 +2789,10 @@ class Language {
         * depending on "count mod 10". See [[w:Plural]]
         * For English it is pretty simple.
         *
-        * Invoked by putting {{pluralform:count|wordform1|wordform2}}
-        * or {{pluralform:count|wordform1|wordform2|wordform3}}
+        * Invoked by putting {{plural:count|wordform1|wordform2}}
+        * or {{plural:count|wordform1|wordform2|wordform3}}
         *
-        * Example: {{pluralform:{{NUMBEROFARTICLES}}|article|articles}} 
+        * Example: {{plural:{{NUMBEROFARTICLES}}|article|articles}} 
         *
         * @param string $count
         * @param string $wordform1
@@ -2800,9 +2800,8 @@ class Language {
         * @param string $wordform3 (optional)
         * @return string
         */
-       function convertPluralForm( $count, $wordform1, $wordform2, $wordform3) {
-               if ($count==1) {return $wordform1;}
-               else {return $wordform2;}
+       function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
+               return $count == 1 ? $wordform1 : $wordform2;
        }
 
        /**
index 2454cca..777a47f 100644 (file)
@@ -2000,7 +2000,7 @@ class LanguageRu extends LanguageUtf8 {
                return $word;
        }
 
-       function convertPluralForm( $count, $wordform1, $wordform2, $wordform3) {
+       function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
                if ($count > 10 && floor(($count % 100) / 10) == 1) {
                        return $wordform3;
                }