* Removed getNsText() decleration, redundant now that the parent defines it in
[lhc/web/wiklou.git] / languages / LanguageAr.php
1 <?php
2 /** Arabic (العربية)
3 *
4 * @package MediaWiki
5 * @subpackage Language
6 */
7
8 require_once('LanguageUtf8.php');
9
10 /* private */ $wgNamespaceNamesAr = array(
11 NS_MEDIA => 'ملف',
12 NS_SPECIAL => 'خاص',
13 NS_MAIN => '',
14 NS_TALK => 'نقاش',
15 NS_USER => 'مستخدم',
16 NS_USER_TALK => 'نقاش_المستخدم',
17 NS_PROJECT => 'ويكيبيديا',
18 NS_PROJECT_TALK => 'نقاش_ويكيبيديا',
19 NS_IMAGE => 'صورة',
20 NS_IMAGE_TALK => 'نقاش_الصورة',
21 NS_MEDIAWIKI => 'ميدياويكي',
22 NS_MEDIAWIKI_TALK => 'نقاش_ميدياويكي',
23 NS_TEMPLATE => 'Template',
24 NS_TEMPLATE_TALK => 'نقاش_Template',
25 NS_HELP => 'مساعدة',
26 NS_HELP_TALK => 'نقاش_المساعدة',
27 NS_CATEGORY => 'تصنيف',
28 NS_CATEGORY_TALK => 'نقاش_التصنيف'
29 ) + $wgNamespaceNamesEn;
30
31
32 /* private */ $wgAllMessagesAr = array(
33 # Dates
34 'sunday' => 'الأحد',
35 'monday' => 'الإثنين',
36 'tuesday' => 'الثلاثاء',
37 'wednesday' => 'الأربعاء',
38 'thursday' => 'الخميس',
39 'friday' => 'الجمعة',
40 'saturday' => 'السبت',
41 'january' => 'يناير',
42 'february' => 'فبراير',
43 'march' => 'مارس',
44 'april' => 'ابريل',
45 'may_long' => 'مايو',
46 'june' => 'يونيو',
47 'july' => 'يوليو',
48 'august' => 'أغسطس',
49 'september' => 'سبتمبر',
50 'november' => 'نوفمبر',
51 'december' => 'ديسمبر',
52
53 # Bits of text used by many pages:
54 #
55 'mainpage' => 'الصفحة الرئيسية',
56 'mytalk' => 'صفحة نقاشي',
57 'history_short' => 'تاريخ الصفحة',
58 'edit' => 'عدل هذه الصفحة',
59 'delete' => 'حذف هذه الصفحة',
60 'protect' => 'صفحة محمية',
61 'talk' => 'ناقش هذه الصفحة',
62
63 # Watchlist
64 #
65 'watch' => 'راقب هذه الصفحة',
66 'watchthispage' => 'راقب هذه الصفحة',
67 'unwatch' => 'توقف عن مراقبة الصفحة',
68 'unwatchthispage' => 'توقف عن مراقبة الصفحة',
69 );
70
71 class LanguageAr extends LanguageUtf8 {
72 var $digitTransTable = array(
73 '0' => '٠',
74 '1' => '١',
75 '2' => '٢',
76 '3' => '٣',
77 '4' => '٤',
78 '5' => '٥',
79 '6' => '٦',
80 '7' => '٧',
81 '8' => '٨',
82 '9' => '٩',
83 '%' => '٪',
84 '.' => '٫',
85 ',' => '٬'
86 );
87
88 function getNamespaces() {
89 global $wgNamespaceNamesAr;
90 return $wgNamespaceNamesAr;
91 }
92
93
94 function getNsIndex( $text ) {
95 global $wgNamespaceNamesAr;
96
97 foreach ( $wgNamespaceNamesAr as $i => $n ) {
98 if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
99 }
100 return LanguageUtf8::getNsIndex( $text );
101 }
102
103 function getMonthAbbreviation( $key ) {
104 /* No abbreviations in Arabic */
105 return $this->getMonthName( $key );
106 }
107
108 function isRTL() {
109 return true;
110 }
111
112 function linkPrefixExtension() {
113 return true;
114 }
115
116 function getDefaultUserOptions() {
117 $opt = parent::getDefaultUserOptions();
118
119 # Swap sidebar to right side by default
120 $opt['quickbar'] = 2;
121
122 # Underlines seriously harm legibility. Force off:
123 $opt['underline'] = 0;
124 return $opt ;
125 }
126
127 function fallback8bitEncoding() {
128 return 'windows-1256';
129 }
130
131 function getMessage( $key ) {
132 global $wgAllMessagesAr, $wgAllMessagesEn;
133 $m = $wgAllMessagesAr[$key];
134
135 if ( '' == $m ) { return $wgAllMessagesEn[$key]; }
136 else return $m;
137 }
138
139 function formatNum( $number ) {
140 global $wgTranslateNumerals;
141 if( $wgTranslateNumerals ) {
142 return strtr( $number, $this->digitTransTable );
143 } else {
144 return $number;
145 }
146 }
147 }
148
149 ?>