LanguageLt.php 690 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /** Lithuanian (Lietuvių)
  3. *
  4. * @ingroup Language
  5. */
  6. class LanguageLt extends Language {
  7. /* Word forms (with examples):
  8. 1 - vienas (1) lapas, dvidešimt vienas (21) lapas
  9. 2 - trys (3) lapai
  10. 3 - penkiolika (15) lapų
  11. */
  12. function convertPlural( $count, $forms ) {
  13. if ( !count($forms) ) { return ''; }
  14. //if no number with word, then use $form[0] for singular and $form[1] for plural or zero
  15. if( count($forms) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
  16. $forms = $this->preConvertPlural( $forms, 3 );
  17. if ($count%10==1 && $count%100!=11) return $forms[0];
  18. if ($count%10>=2 && ($count%100<10 || $count%100>=20)) return $forms[1];
  19. return $forms[2];
  20. }
  21. }