LanguageLv.php 884 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /** Latvian (Latviešu)
  3. *
  4. * @ingroup Language
  5. *
  6. * @author Niklas Laxström
  7. *
  8. * @copyright Copyright © 2006, Niklas Laxström
  9. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
  10. */
  11. class LanguageLv extends Language {
  12. /**
  13. * Plural form transformations. Using the first form for words with the last digit 1, but not for words with the last digits 11, and the second form for all the others.
  14. *
  15. * Example: {{plural:{{NUMBEROFARTICLES}}|article|articles}}
  16. *
  17. * @param integer $count
  18. * @param string $wordform1
  19. * @param string $wordform2
  20. * @param string $wordform3 (not used)
  21. * @return string
  22. */
  23. function convertPlural( $count, $forms ) {
  24. if ( !count($forms) ) { return ''; }
  25. $forms = $this->preConvertPlural( $forms, 2 );
  26. return ( ( $count % 10 == 1 ) && ( $count % 100 != 11 ) ) ? $forms[0] : $forms[1];
  27. }
  28. }