r109021 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109020‎ | r109021 | r109022 >
Date:09:46, 16 January 2012
Author:amire80
Status:resolved (Comments)
Tags:
Comment:
Improved the comment about the two-forms plural shortcut.
Modified paths:
  • /trunk/phase3/languages/classes/LanguageBe_tarask.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageRu.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageSr.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageUk.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/classes/LanguageUk.php
@@ -71,7 +71,10 @@
7272 function convertPlural( $count, $forms ) {
7373 if ( !count( $forms ) ) { return ''; }
7474
75 - // if no number with word, then use $form[0] for singular and $form[1] for plural or zero
 75+ // If the actual number is not mentioned in the expression, then just two forms are enough:
 76+ // singular for $count == 1
 77+ // plural for $count != 0
 78+ // For example, "This user belongs to {{PLURAL:$1|one group|several groups}}."
7679 if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
7780
7881 // @todo FIXME: CLDR defines 4 plural forms. Form for decimals is missing/
Index: trunk/phase3/languages/classes/LanguageRu.php
@@ -82,7 +82,10 @@
8383 function convertPlural( $count, $forms ) {
8484 if ( !count( $forms ) ) { return ''; }
8585
86 - // if no number with word, then use $form[0] for singular and $form[1] for plural or zero
 86+ // If the actual number is not mentioned in the expression, then just two forms are enough:
 87+ // singular for $count == 1
 88+ // plural for $count != 0
 89+ // For example, "This user belongs to {{PLURAL:$1|one group|several groups}}."
8790 if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
8891
8992 // @todo FIXME: CLDR defines 4 plural forms. Form with decimals missing.
Index: trunk/phase3/languages/classes/LanguageBe_tarask.php
@@ -27,7 +27,10 @@
2828 function convertPlural( $count, $forms ) {
2929 if ( !count( $forms ) ) { return ''; }
3030
31 - // if no number with word, then use $form[0] for singular and $form[1] for plural or zero
 31+ // If the actual number is not mentioned in the expression, then just two forms are enough:
 32+ // singular for $count == 1
 33+ // plural for $count != 0
 34+ // For example, "This user belongs to {{PLURAL:$1|one group|several groups}}."
3235 if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
3336
3437 // @todo FIXME: CLDR defines 4 plural forms instead of 3
Index: trunk/phase3/languages/classes/LanguageSr.php
@@ -238,7 +238,10 @@
239239 return '';
240240 }
241241
242 - // if no number with word, then use $form[0] for singular and $form[1] for plural or zero
 242+ // If the actual number is not mentioned in the expression, then just two forms are enough:
 243+ // singular for $count == 1
 244+ // plural for $count != 0
 245+ // For example, "This user belongs to {{PLURAL:$1|one group|several groups}}."
243246 if ( count( $forms ) === 2 ) {
244247 return $count == 1 ? $forms[0] : $forms[1];
245248 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r109026Follow up to r109021, corrected the comment, and added a translation from Rus...amire8010:45, 16 January 2012

Comments

#Comment by Nikerabbit (talk | contribs)   10:14, 16 January 2012
+		// singular for $count == 1
+		// plural   for $count != 0

Makes no sense, did you mean != 1?

#Comment by Amire80 (talk | contribs)   10:45, 16 January 2012

Of course, r109026.

Status & tagging log