MediaWiki
REL1_20
|
00001 <?php 00029 class LanguageLt extends Language { 00030 /* Word forms (with examples): 00031 1 - vienas (1) lapas, dvidešimt vienas (21) lapas 00032 2 - trys (3) lapai 00033 3 - penkiolika (15) lapų 00034 */ 00035 00043 function convertPlural( $count, $forms ) { 00044 if ( !count( $forms ) ) { return ''; } 00045 00046 // if the number is not mentioned in message, then use $form[0] for singular and $form[1] for plural or zero 00047 if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1]; 00048 00049 $forms = $this->preConvertPlural( $forms, 3 ); 00050 // Form[0] if n mod 10 is 1 and n mod 100 not in 11..19; 00051 if ( $count % 10 == 1 && $count % 100 != 11 ) return $forms[0]; 00052 // Forms[1] if n mod 10 in 2..9 and n mod 100 not in 11..19; 00053 if ( $count % 10 >= 2 && ( $count % 100 < 10 || $count % 100 >= 20 ) ) return $forms[1]; 00054 return $forms[2]; 00055 } 00056 }