LanguageAr.php 509 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /** Arabic (العربية)
  3. *
  4. * @ingroup Language
  5. *
  6. * @author Niklas Laxström
  7. */
  8. class LanguageAr extends Language {
  9. function convertPlural( $count, $forms ) {
  10. if ( !count($forms) ) { return ''; }
  11. $forms = $this->preConvertPlural( $forms, 5 );
  12. if ( $count == 1 ) {
  13. $index = 0;
  14. } elseif( $count == 2 ) {
  15. $index = 1;
  16. } elseif( $count < 11 && $count > 2 ) {
  17. $index = 2;
  18. } elseif( $count % 100 == 0) {
  19. $index = 3;
  20. } else {
  21. $index = 4;
  22. }
  23. return $forms[$index];
  24. }
  25. }