r51745 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51744‎ | r51745 | r51746 >
Date:14:41, 11 June 2009
Author:mfarag
Status:ok
Tags:
Comment:
Use the new and more accurate classes for Arabic per
http://ar.wikipedia.org/w/index.php?oldid=3406056
Modified paths:
  • /trunk/phase3/languages/classes/LanguageAr.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/classes/LanguageAr.php
@@ -9,18 +9,20 @@
1010
1111 function convertPlural( $count, $forms ) {
1212 if ( !count($forms) ) { return ''; }
13 - $forms = $this->preConvertPlural( $forms, 5 );
 13+ $forms = $this->preConvertPlural( $forms, 6 );
1414
15 - if ( $count == 1 ) {
 15+ if ( $count == 0 ) {
1616 $index = 0;
 17+ } elseif ( $count == 1 ) {
 18+ $index = 1;
1719 } elseif( $count == 2 ) {
18 - $index = 1;
19 - } elseif( $count < 11 && $count > 2 ) {
2020 $index = 2;
21 - } elseif( $count % 100 == 0) {
 21+ } elseif( $count % 100 >= 3 && $count % 100 <= 10 ) {
2222 $index = 3;
 23+ } elseif( $count % 100 >= 11 && $count % 100 <= 99 ) {
 24+ $index = 4;
2325 } else {
24 - $index = 4;
 26+ $index = 5;
2527 }
2628 return $forms[$index];
2729 }

Status & tagging log