MediaWiki  REL1_19
LanguageLt.php
Go to the documentation of this file.
00001 <?php
00002 
00007 class LanguageLt extends Language {
00008         /* Word forms (with examples):
00009                 1 - vienas (1) lapas, dvidešimt vienas (21) lapas
00010                 2 - trys (3) lapai
00011                 3 - penkiolika (15) lapų
00012         */
00013 
00021         function convertPlural( $count, $forms ) {
00022                 if ( !count( $forms ) ) { return ''; }
00023 
00024                 // if the number is not mentioned in message, then use $form[0] for singular and $form[1] for plural or zero
00025                 if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
00026 
00027                 $forms = $this->preConvertPlural( $forms, 3 );
00028                 // Form[0] if n mod 10 is 1 and n mod 100 not in 11..19;
00029                 if ( $count % 10 == 1 && $count % 100 != 11 ) return $forms[0];
00030                 // Forms[1] if n mod 10 in 2..9 and n mod 100 not in 11..19;
00031                 if ( $count % 10 >= 2 && ( $count % 100 < 10 || $count % 100 >= 20 ) ) return $forms[1];
00032                 return $forms[2];
00033         }
00034 }