LanguageBs.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /** Bosnian (bosanski)
  3. *
  4. * @ingroup Language
  5. */
  6. class LanguageBs extends Language {
  7. function convertPlural( $count, $forms ) {
  8. if ( !count($forms) ) { return ''; }
  9. $forms = $this->preConvertPlural( $forms, 3 );
  10. if ($count > 10 && floor(($count % 100) / 10) == 1) {
  11. return $forms[2];
  12. } else {
  13. switch ($count % 10) {
  14. case 1: return $forms[0];
  15. case 2:
  16. case 3:
  17. case 4: return $forms[1];
  18. default: return $forms[2];
  19. }
  20. }
  21. }
  22. # Convert from the nominative form of a noun to some other case
  23. # Invoked with {{GRAMMAR:case|word}}
  24. /**
  25. * Cases: genitiv, dativ, akuzativ, vokativ, instrumental, lokativ
  26. */
  27. function convertGrammar( $word, $case ) {
  28. global $wgGrammarForms;
  29. if ( isset($wgGrammarForms['bs'][$case][$word]) ) {
  30. return $wgGrammarForms['bs'][$case][$word];
  31. }
  32. switch ( $case ) {
  33. case 'instrumental': # instrumental
  34. $word = 's ' . $word;
  35. break;
  36. case 'lokativ': # locative
  37. $word = 'o ' . $word;
  38. break;
  39. }
  40. return $word; # this will return the original value for 'nominativ' (nominative) and all undefined case values
  41. }
  42. }