Fix toolbar scrolling bug in Mozilla, toolbar can now be safely and fully
[lhc/web/wiklou.git] / languages / LanguageAr.php
1 <?php
2 # See language.doc
3 include_once("LanguageUtf8.php");
4
5 /* private */ $wgNamespaceNamesAr = array(
6 -2 => "ملف",
7 -1 => "خاص",
8 0 => "",
9 1 => "نقاش",
10 2 => "مستخدم",
11 3 => "نقاش_المستخدم",
12 4 => "ويكيبيديا",
13 5 => "ويكيبيديا_نقاش",
14 6 => "صورة",
15 7 => "نقاش_الصورة",
16 8 => "MediaWiki",
17 9 => "MediaWiki_talk",
18 10 => "Template",
19 11 => "Template_talk"
20 );
21
22 /* private */ $wgWeekdayNamesAr = array(
23 "الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس",
24 "الجمعة", "السبت"
25 );
26
27 /* private */ $wgMonthNamesAr = array(
28 "يناير", "فبراير", "مارس", "ابريل", "مايو", "يونيو",
29 "يوليو", "أغسطس", "سبتمبر", "اكتوبر", "نوفمبر",
30 "ديسمبر"
31 );
32
33 class LanguageAr extends LanguageUtf8 {
34 var $digitTransTable = array(
35 "0" => "٠",
36 "1" => "١",
37 "2" => "٢",
38 "3" => "٣",
39 "4" => "٤",
40 "5" => "٥",
41 "6" => "٦",
42 "7" => "٧",
43 "8" => "٨",
44 "9" => "٩",
45 "%" => "٪",
46 "." => "٫",
47 "," => "٬"
48 );
49
50 # TODO: TRANSLATION!
51
52 # Inherit everything except...
53
54 function getNamespaces()
55 {
56 global $wgNamespaceNamesAr;
57 return $wgNamespaceNamesAr;
58 }
59
60
61 function getNsText( $index )
62 {
63 global $wgNamespaceNamesAr;
64 return $wgNamespaceNamesAr[$index];
65 }
66
67 function getNsIndex( $text )
68 {
69 global $wgNamespaceNamesAr;
70
71 foreach ( $wgNamespaceNamesAr as $i => $n )
72 {
73 if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
74 }
75 return LanguageUtf8::getNsIndex( $text );
76 }
77
78 function getMonthName( $key )
79 {
80 global $wgMonthNamesAr;
81 return $wgMonthNamesAr[$key-1];
82 }
83
84 function getMonthAbbreviation( $key )
85 {
86 /* No abbreviations in Arabic */
87 return $this->getMonthName( $key );
88 }
89
90 function getWeekdayName( $key )
91 {
92 global $wgWeekdayNamesAr;
93 return $wgWeekdayNamesAr[$key-1];
94 }
95
96 function isRTL() { return true; }
97
98 function linkPrefixExtension() { return true; }
99
100 function getDefaultUserOptions () {
101 global $wgDefaultUserOptionsEn;
102 $opt = $wgDefaultUserOptionsEn;
103
104 # Swap sidebar to right side by default
105 $opt['quickbar'] = 2;
106
107 # Underlines seriously harm legibility. Force off:
108 $opt['underline'] = 0;
109 return $opt ;
110 }
111
112 function checkTitleEncoding( $s ) {
113 global $wgInputEncoding;
114
115 # Check for non-UTF-8 URLs; assume they are windows-1256?
116 $ishigh = preg_match( '/[\x80-\xff]/', $s);
117 $isutf = ($ishigh ? preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
118 '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true );
119
120 if( $ishigh and !$isutf )
121 return iconv( "windows-1256", "utf-8", $s );
122
123 return $s;
124 }
125
126 function formatNum( $number ) {
127 return strtr( $number, $this->digitTransTable );
128 }
129 }
130
131 ?>