another one deprecated
[mediawiki.git] / languages / LanguageAr.php
blob04fe6a60f18fbadee95a46399691b12a470831d1
1 <?php
2 # See language.doc
3 include_once("LanguageUtf8.php");
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"
22 /* private */ $wgWeekdayNamesAr = array(
23 "الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس",
24 "الجمعة", "السبت"
27 /* private */ $wgMonthNamesAr = array(
28 "يناير", "فبراير", "مارس", "ابريل", "مايو", "يونيو",
29 "يوليو", "أغسطس", "سبتمبر", "اكتوبر", "نوفمبر",
30 "ديسمبر"
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 "," => "٬"
50 # TODO: TRANSLATION!
52 # Inherit everything except...
54 function getNamespaces()
56 global $wgNamespaceNamesAr;
57 return $wgNamespaceNamesAr;
61 function getNsText( $index )
63 global $wgNamespaceNamesAr;
64 return $wgNamespaceNamesAr[$index];
67 function getNsIndex( $text )
69 global $wgNamespaceNamesAr;
71 foreach ( $wgNamespaceNamesAr as $i => $n )
73 if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
75 return LanguageUtf8::getNsIndex( $text );
78 function getMonthName( $key )
80 global $wgMonthNamesAr;
81 return $wgMonthNamesAr[$key-1];
84 function getMonthAbbreviation( $key )
86 /* No abbreviations in Arabic */
87 return $this->getMonthName( $key );
90 function getWeekdayName( $key )
92 global $wgWeekdayNamesAr;
93 return $wgWeekdayNamesAr[$key-1];
96 function isRTL() { return true; }
98 function linkPrefixExtension() { return true; }
100 function getDefaultUserOptions () {
101 global $wgDefaultUserOptionsEn;
102 $opt = $wgDefaultUserOptionsEn;
104 # Swap sidebar to right side by default
105 $opt['quickbar'] = 2;
107 # Underlines seriously harm legibility. Force off:
108 $opt['underline'] = 0;
109 return $opt ;
112 function checkTitleEncoding( $s ) {
113 global $wgInputEncoding;
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 );
120 if( $ishigh and !$isutf )
121 return iconv( "windows-1256", "utf-8", $s );
123 return $s;
126 function formatNum( $number ) {
127 return strtr( $number, $this->digitTransTable );