MediaWiki  REL1_19
LanguageAr.php
Go to the documentation of this file.
00001 <?php
00008 class LanguageAr extends Language {
00009 
00015         function convertPlural( $count, $forms ) {
00016                 if ( !count( $forms ) ) { return ''; }
00017                 $forms = $this->preConvertPlural( $forms, 6 );
00018 
00019                 if ( $count == 0 ) {
00020                         $index = 0;
00021                 } elseif ( $count == 1 ) {
00022                         $index = 1;
00023                 } elseif ( $count == 2 ) {
00024                         $index = 2;
00025                 } elseif ( $count % 100 >= 3 && $count % 100 <= 10 ) {
00026                         $index = 3;
00027                 } elseif ( $count % 100 >= 11 && $count % 100 <= 99 ) {
00028                         $index = 4;
00029                 } else {
00030                         $index = 5;
00031                 }
00032                 return $forms[$index];
00033         }
00034 
00046         function normalize( $s ) {
00047                 global $wgFixArabicUnicode;
00048                 $s = parent::normalize( $s );
00049                 if ( $wgFixArabicUnicode ) {
00050                         $s = $this->transformUsingPairFile( 'normalize-ar.ser', $s );
00051                 }
00052                 return $s;
00053         }
00054 }