3 include_once("LanguageUtf8.php");
5 $wgNamespaceNamesAr = array(
11 "3" => "نقاش_المستخدم",
13 "5" => "ويكيبيديا_نقاش",
17 "9" => "MediaWiki_talk",
20 class LanguageAr
extends LanguageUtf8
{
23 # Inherit everything except...
25 function getNamespaces()
27 global $wgNamespaceNamesAr;
28 return $wgNamespaceNamesAr;
32 function getNsText( $index )
34 global $wgNamespaceNamesAr;
35 return $wgNamespaceNamesAr[$index];
38 function getNsIndex( $text )
40 global $wgNamespaceNamesAr;
42 foreach ( $wgNamespaceNamesAr as $i => $n )
44 if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
46 return LanguageUtf8
::getNsIndex( $text );
49 function isRTL() { return true; }
51 function getDefaultUserOptions () {
52 global $wgDefaultUserOptionsEn;
53 $opt = $wgDefaultUserOptionsEn;
55 # Swap sidebar to right side by default
60 function checkTitleEncoding( $s ) {
61 global $wgInputEncoding;
63 # Check for non-UTF-8 URLs; assume they are windows-1256?
64 $ishigh = preg_match( '/[\x80-\xff]/', $s);
65 $isutf = ($ishigh ?
preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
66 '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true );
68 if( $ishigh and !$isutf )
69 return iconv( "windows-1256", "utf-8", $s );