r109022 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109021‎ | r109022 | r109023 >
Date:10:05, 16 January 2012
Author:santhosh
Status:ok
Tags:
Comment:
reintroduce the shortcut evaluation removed in r108403 and r108405
Modified paths:
  • /trunk/phase3/languages/classes/LanguageLt.php (modified) (history)
  • /trunk/phase3/resources/mediawiki.language/languages/lt.js (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/classes/LanguageLt.php
@@ -20,6 +20,10 @@
2121 */
2222 function convertPlural( $count, $forms ) {
2323 if ( !count( $forms ) ) { return ''; }
 24+
 25+ // if the number is not mentioned in message, then use $form[0] for singular and $form[1] for plural or zero
 26+ if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
 27+
2428 $forms = $this->preConvertPlural( $forms, 3 );
2529 // Form[0] if n mod 10 is 1 and n mod 100 not in 11..19;
2630 if ( $count % 10 == 1 && $count % 100 != 11 ) return $forms[0];
Index: trunk/phase3/resources/mediawiki.language/languages/lt.js
@@ -3,6 +3,10 @@
44 */
55
66 mediaWiki.language.convertPlural = function( count, forms ) {
 7+ // if the number is not mentioned in message, then use $form[0] for singular and $form[1] for plural or zero
 8+ if ( forms.length == 2 ) {
 9+ return count == 1 ? forms[0] : forms[1];
 10+ }
711 forms = mediaWiki.language.preConvertPlural( forms, 3 );
812 if ( count % 10 == 1 && count % 100 != 11 ) {
913 return forms[0];

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108403Cleanup the convertPLural method for Lithuanian(lt)...santhosh12:46, 9 January 2012
r108405Cleanup the convertPLural method for Lithuanian(lt)...santhosh12:58, 9 January 2012

Status & tagging log