3 include_once("LanguageUtf8.php");
5 /* private */ $wgNamespaceNamesAr = array(
13 5 => "ويكيبيديا_نقاش",
17 9 => "MediaWiki_talk",
22 /* private */ $wgWeekdayNamesAr = array(
23 "الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس",
27 /* private */ $wgMonthNamesAr = array(
28 "يناير", "فبراير", "مارس", "ابريل", "مايو", "يونيو",
29 "يوليو", "أغسطس", "سبتمبر", "اكتوبر", "نوفمبر",
33 class LanguageAr
extends LanguageUtf8
{
34 var $digitTransTable = array(
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;
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 );
126 function formatNum( $number ) {
127 return strtr( $number, $this->digitTransTable
);