aboutsummaryrefslogtreecommitdiffstats
path: root/languages/LanguageAr.php
blob: 5d8aabb07adfd1c52fd52278fcf82b0b1f7d49c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?php
/** Arabic (العربية)
  *
  * @package MediaWiki
  * @subpackage Language
  */

require_once('LanguageUtf8.php');

/* private */ $wgNamespaceNamesAr = array(
        NS_MEDIA            => 'ملف',
        NS_SPECIAL          => 'خاص',
        NS_MAIN             => '',
        NS_TALK             => 'نقاش',
        NS_USER             => 'مستخدم',
        NS_USER_TALK        => 'نقاش_المستخدم',
        NS_PROJECT          => 'ويكيبيديا',
        NS_PROJECT_TALK     => 'نقاش_ويكيبيديا',
        NS_IMAGE            => 'صورة',
        NS_IMAGE_TALK       => 'نقاش_الصورة',
        NS_MEDIAWIKI        => 'ميدياويكي',
        NS_MEDIAWIKI_TALK   => 'نقاش_ميدياويكي',
        NS_TEMPLATE         => 'Template',
        NS_TEMPLATE_TALK    => 'نقاش_Template',
        NS_HELP             => 'مساعدة',
        NS_HELP_TALK        => 'نقاش_المساعدة',
        NS_CATEGORY         => 'تصنيف',
        NS_CATEGORY_TALK    => 'نقاش_التصنيف'
) + $wgNamespaceNamesEn;


/* private */ $wgAllMessagesAr = array(
# Dates
'sunday' => 'الأحد',
'monday' => 'الإثنين',
'tuesday' => 'الثلاثاء',
'wednesday' => 'الأربعاء',
'thursday' => 'الخميس',
'friday' => 'الجمعة',
'saturday' => 'السبت',
'january' => 'يناير',
'february' => 'فبراير',
'march' => 'مارس',
'april' => 'ابريل',
'may_long' => 'مايو',
'june' => 'يونيو',
'july' => 'يوليو',
'august' => 'أغسطس',
'september' => 'سبتمبر',
'november' => 'نوفمبر',
'december' => 'ديسمبر',

# Bits of text used by many pages:
#
'mainpage'		=> 'الصفحة الرئيسية',
'mytalk'		=> 'صفحة نقاشي',
'history_short' => 'تاريخ الصفحة',
'edit' => 'عدل هذه الصفحة',
'delete' => 'حذف هذه الصفحة',
'protect' => 'صفحة محمية',
'talk' => 'ناقش هذه الصفحة',

# Watchlist
#
'watch' => 'راقب هذه الصفحة',
'watchthispage'		=> 'راقب هذه الصفحة',
'unwatch' => 'توقف عن مراقبة الصفحة',
'unwatchthispage' 	=> 'توقف عن مراقبة الصفحة',
);

class LanguageAr extends LanguageUtf8 {
	var $digitTransTable = array(
		'0' => '٠',
		'1' => '١',
		'2' => '٢',
		'3' => '٣',
		'4' => '٤',
		'5' => '٥',
		'6' => '٦',
		'7' => '٧',
		'8' => '٨',
		'9' => '٩',
		'%' => '٪',
		'.' => '٫',
		',' => '٬'
	);

	function getNamespaces() {
		global $wgNamespaceNamesAr;
		return $wgNamespaceNamesAr;
	}

	function getNsText( $index ) {
		global $wgNamespaceNamesAr;
		return $wgNamespaceNamesAr[$index];
	}

	function getNsIndex( $text ) {
		global $wgNamespaceNamesAr;

		foreach ( $wgNamespaceNamesAr as $i => $n ) {
			if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
		}
		return LanguageUtf8::getNsIndex( $text );
	}

	function getMonthAbbreviation( $key ) {
		/* No abbreviations in Arabic */
		return $this->getMonthName( $key );
	}

	function isRTL() {
		return true;
	}

	function linkPrefixExtension() {
		return true;
	}

	function getDefaultUserOptions() {
		$opt = parent::getDefaultUserOptions();

		# Swap sidebar to right side by default
		$opt['quickbar'] = 2;

		# Underlines seriously harm legibility. Force off:
		$opt['underline'] = 0;
		return $opt ;
	}

	function fallback8bitEncoding() {
		return 'windows-1256';
	}

	function getMessage( $key ) {
		global $wgAllMessagesAr, $wgAllMessagesEn;
		$m = $wgAllMessagesAr[$key];

		if ( '' == $m ) { return $wgAllMessagesEn[$key]; }
		else return $m;
	}

	function formatNum( $number ) {
		global $wgTranslateNumerals;
		if( $wgTranslateNumerals ) {
			return strtr( $number, $this->digitTransTable );
		} else {
			return $number;
		}
	}
}

?>