b4c5276b8f387a878dda25057d855b66a80683c9
3 include_once("LanguageUtf8.php");
5 /* private */ $wgNamespaceNamesAr = array(
13 5 => "ويكيبيديا_نقاش",
17 9 => "MediaWiki_talk",
20 /* private */ $wgWeekdayNamesAr = array(
21 "الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس",
25 /* private */ $wgMonthNamesAr = array(
26 "يناير", "فبراير", "مارس", "ابريل", "مايو", "يونيو",
27 "يوليو", "أغسطس", "سبتمبر", "اكتوبر", "نوفمبر",
31 class LanguageAr
extends LanguageUtf8
{
32 var $digitTransTable = array(
50 # Inherit everything except...
52 function getNamespaces()
54 global $wgNamespaceNamesAr;
55 return $wgNamespaceNamesAr;
59 function getNsText( $index )
61 global $wgNamespaceNamesAr;
62 return $wgNamespaceNamesAr[$index];
65 function getNsIndex( $text )
67 global $wgNamespaceNamesAr;
69 foreach ( $wgNamespaceNamesAr as $i => $n )
71 if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
73 return LanguageUtf8
::getNsIndex( $text );
76 function getMonthName( $key )
78 global $wgMonthNamesAr;
79 return $wgMonthNamesAr[$key-1];
82 function getMonthAbbreviation( $key )
84 /* No abbreviations in Arabic */
85 return $this->getMonthName( $key );
88 function getWeekdayName( $key )
90 global $wgWeekdayNamesAr;
91 return $wgWeekdayNamesAr[$key-1];
94 function isRTL() { return true; }
96 function linkPrefixExtension() { return true; }
98 function getDefaultUserOptions () {
99 global $wgDefaultUserOptionsEn;
100 $opt = $wgDefaultUserOptionsEn;
102 # Swap sidebar to right side by default
103 $opt['quickbar'] = 2;
105 # Underlines seriously harm legibility. Force off:
106 $opt['underline'] = 0;
110 function checkTitleEncoding( $s ) {
111 global $wgInputEncoding;
113 # Check for non-UTF-8 URLs; assume they are windows-1256?
114 $ishigh = preg_match( '/[\x80-\xff]/', $s);
115 $isutf = ($ishigh ?
preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
116 '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true );
118 if( $ishigh and !$isutf )
119 return iconv( "windows-1256", "utf-8", $s );
124 function formatNum( $number ) {
125 return strtr( $number, $this->digitTransTable
);