Localisation update for core and extension messages from translatewiki.net (2011...
[lhc/web/wiklou.git] / languages / classes / LanguageAr.php
1 <?php
2 /** Arabic (العربية)
3 *
4 * @ingroup Language
5 *
6 * @author Niklas Laxström
7 */
8 class LanguageAr extends Language {
9
10 /**
11 * @param $count int
12 * @param $forms array
13 * @return string
14 */
15 function convertPlural( $count, $forms ) {
16 if ( !count( $forms ) ) { return ''; }
17 $forms = $this->preConvertPlural( $forms, 6 );
18
19 if ( $count == 0 ) {
20 $index = 0;
21 } elseif ( $count == 1 ) {
22 $index = 1;
23 } elseif ( $count == 2 ) {
24 $index = 2;
25 } elseif ( $count % 100 >= 3 && $count % 100 <= 10 ) {
26 $index = 3;
27 } elseif ( $count % 100 >= 11 && $count % 100 <= 99 ) {
28 $index = 4;
29 } else {
30 $index = 5;
31 }
32 return $forms[$index];
33 }
34
35 /**
36 * Temporary hack for bug 9413: replace Arabic presentation forms with their
37 * standard equivalents.
38 *
39 * @todo FIXME: This is language-specific for now only to avoid the negative
40 * performance impact of enabling it for all languages.
41 *
42 * @param $s string
43 *
44 * @return string
45 */
46 function normalize( $s ) {
47 global $wgFixArabicUnicode;
48 $s = parent::normalize( $s );
49 if ( $wgFixArabicUnicode ) {
50 $s = $this->transformUsingPairFile( 'normalize-ar.ser', $s );
51 }
52 return $s;
53 }
54 }