Add namespaces
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 9 Feb 2004 01:50:38 +0000 (01:50 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 9 Feb 2004 01:50:38 +0000 (01:50 +0000)
languages/LanguageAr.php

index 7cca4f6..a016e36 100644 (file)
@@ -2,11 +2,50 @@
 # See language.doc
 include_once("LanguageUtf8.php");
 
+$wgNamespaceNamesAr = array(
+       "-2" => "ملف",
+       "-1" => "خاص",
+       "0" => "",
+       "1" => "نقاش",
+       "2" => "مستخدم",
+       "3" => "نقاش_المستخدم",
+       "4" => "ويكيبيديا",
+       "5" => "ويكيبيديا_نقاش",
+       "6" => "صورة",
+       "7" => "نقاش_الصورة",
+       "8" => "MediaWiki",
+       "9" => "MediaWiki_talk",
+);
+
 class LanguageAr extends LanguageUtf8 {
        # TODO: TRANSLATION!
 
        # Inherit everything except...
 
+       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 isRTL() { return true; }
 
        function getDefaultUserOptions () {