LanguageKsh.php 723 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /** Ripuarian (Ripoarėsh)
  3. *
  4. * @ingroup Language
  5. *
  6. * @author Purodha Blissenbach
  7. */
  8. class LanguageKsh extends Language {
  9. /**
  10. * Avoid grouping whole numbers between 0 to 9999
  11. */
  12. public function commafy( $_ ) {
  13. if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
  14. return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
  15. } else {
  16. return $_;
  17. }
  18. }
  19. /**
  20. * Handle cases of (1, other, 0) or (1, other)
  21. */
  22. function convertPlural( $count, $forms ) {
  23. if ( !count($forms) ) { return ''; }
  24. $forms = $this->preConvertPlural( $forms, 3 );
  25. if ( $count == 1 ) {
  26. return $forms[0];
  27. } elseif ( $count == 0 ) {
  28. return $forms[2];
  29. } else {
  30. return $forms[1];
  31. }
  32. }
  33. }