Code formatting; clean up redundant method declarations.
[lhc/web/wiklou.git] / languages / LanguageAr.php
index 22e2569..881e487 100644 (file)
@@ -3,34 +3,52 @@
 require_once("LanguageUtf8.php");
 
 /* private */ $wgNamespaceNamesAr = array(
-       -2 => "ملف",
-       -1 => "خاص",
-       0 => "",
-       1 => "نقاش",
-       2 => "مستخدم",
-       3 => "نقاش_المستخدم",
-       4 => "ويكيبيديا",
-       5 => "ويكيبيديا_نقاش",
-       6 => "صورة",
-       7 => "نقاش_الصورة",
-       8 => "MediaWiki",
-       9 => "MediaWiki_talk",
-       10  => "Template",
-       11  => "Template_talk"
-) + $wgNamespaceNamesEn;
 
-/* private */ $wgWeekdayNamesAr = array(
-       "الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس",
-       "الجمعة", "السبت"
-);
+        NS_MEDIA            => "ملف",
+        NS_SPECIAL          => "خاص",
+        NS_MAIN             => "",
+        NS_TALK             => "نقاش",
+        NS_USER             => "مستخدم",
+        NS_USER_TALK        => "نقاش_المستخدم",
+        NS_PROJECT             => "ويكيبيديا",
+        NS_PROJECT_TALK   => "نقاش_ويكيبيديا",
+        NS_IMAGE            => "صورة",
+        NS_IMAGE_TALK       => "نقاش_الصورة",
+        NS_MEDIAWIKI        => "ميدياويكي",
+        NS_MEDIAWIKI_TALK   => "نقاش_ميدياويكي",
+        NS_TEMPLATE         => "Template",
+        NS_TEMPLATE_TALK    => "نقاش_Template",
+        NS_HELP             => "مساعدة",
+        NS_HELP_TALK        => "نقاش_المساعدة",
+        NS_CATEGORY         => "تصنيف",
+        NS_CATEGORY_TALK    => "نقاش_التصنيف"
+
+) + $wgNamespaceNamesEn;
 
-/* private */ $wgMonthNamesAr = array(
-       "يناير", "فبراير", "مارس", "ابريل", "مايو", "يونيو",
-       "يوليو", "أغسطس", "سبتمبر", "اكتوبر", "نوفمبر",
-       "ديسمبر"
-);
 
 /* private */ $wgAllMessagesAr = array(
+'special_version_prefix' => '',
+'special_version_postfix' => '',
+       # Dates
+       'sunday' => "الأحد",
+       'monday' => "الإثنين",
+       'tuesday' => "الثلاثاء",
+       'wednesday' => "الأربعاء",
+       'thursday' => "الخميس",
+       'friday' => "الجمعة",
+       'saturday' => "السبت",
+       'january' => "يناير",
+       'february' => "فبراير",
+       'march' => "مارس",
+       'april' => "ابريل",
+       'may_long' => "مايو",
+       'june' => "يونيو",
+       'july' => "يوليو",
+       'august' => "أغسطس",
+       'september' => "سبتمبر",
+       'october' => "اكتوبر",
+       'november' => "نوفمبر",
+       'december' => "ديسمبر",
 
        # Bits of text used by many pages:
        #
@@ -46,7 +64,7 @@ require_once("LanguageUtf8.php");
        'portal'                => 'Community portal',
        'portal-url'            => '{{ns:4}}:Community Portal',
        "about"                 => "About",
-       "aboutwikipedia" => "About {{SITENAME}}",
+       "aboutsite"      => "About {{SITENAME}}",
        "aboutpage"             => "{{ns:4}}:About",
        'article' => 'وجهة نظر',
        "help"                  => "Help",
@@ -77,7 +95,7 @@ require_once("LanguageUtf8.php");
        "disclaimerpage"                => "{{ns:4}}:General_disclaimer",
        "errorpagetitle" => "Error",
        "returnto"              => "Return to $1.",
-       "fromwikipedia" => "From {{SITENAME}}, the free encyclopedia.",
+       "tagline"       => "From {{SITENAME}}, the free encyclopedia.",
        "whatlinkshere" => "Pages that link here",
        "help"                  => "Help",
        "search"                => "Search",
@@ -157,13 +175,6 @@ require_once("LanguageUtf8.php");
        #
        "error"                 => "Error",
        "databaseerror" => "Database error",
-       "dberrortext"   => "A database query syntax error has occurred.
-       This could be because of an illegal search query (see $5),
-       or it may indicate a bug in the software.
-       The last attempted database query was:
-       <blockquote><tt>$1</tt></blockquote>
-       from within function \"<tt>$2</tt>\".
-       MySQL returned error \"<tt>$3: $4</tt>\".",
        "dberrortextcl" => "A database query syntax error has occurred.
        The last attempted database query was:
        \"$1\"
@@ -341,8 +352,8 @@ require_once("LanguageUtf8.php");
        "previewconflict" => "This preview reflects the text in the upper
        text editing area as it will appear if you choose to save.",
        "editing"               => "Editing $1",
-       "sectionedit"   => " (section)",
-       "commentedit"   => " (comment)",
+       'editingsection'                => 'Editing $1 (section)',
+       'editingcomment'                => 'Editing $1 (comment)',
        "editconflict"  => "Edit conflict: $1",
        "explainconflict" => "Someone else has changed this page since you
        started editing it.
@@ -404,9 +415,7 @@ require_once("LanguageUtf8.php");
        # Search results
        #
        "searchresults" => "Search results",
-       "searchhelppage" => "{{ns:4}}:Searching",
-       "searchingwikipedia" => "Searching {{SITENAME}}",
-       "searchresulttext" => "For more information about searching {{SITENAME}}, see $1.",
+       "searchresulttext" => "For more information about searching {{SITENAME}}, see [[Project:Searching|Searching {{SITENAME}}]].",
        "searchquery"   => "For query \"$1\"",
        "badquery"              => "Badly formed search query",
        "badquerytext"  => "We could not process your query.
@@ -544,36 +553,6 @@ require_once("LanguageUtf8.php");
                to upload files.",
                "uploadfile"    => "Upload images, sounds, documents etc.",
                "uploaderror"   => "Upload error",
-               "uploadtext"    => "<strong>STOP!</strong> Before you upload here,
-               make sure to read and follow the <a href=\"{{localurle:Special:Image_use_policy}}\">image use policy</a>.
-               <p>If a file with the name you are specifying already
-               exists on the wiki, it'll be replaced without warning.
-               So unless you mean to update a file, it's a good idea
-               to first check if such a file exists.
-               <p>To view or search previously uploaded images,
-               go to the <a href=\"{{localurle:Special:Imagelist}}\">list of uploaded images</a>.
-               Uploads and deletions are logged on the " .
-               "<a href=\"{{localurle:Project:Upload_log}}\">upload log</a>.
-               <p>Use the form below to upload new image files for use in
-               illustrating your articles.
-               On most browsers, you will see a \"Browse...\" button, which will
-               bring up your operating system's standard file open dialog.
-               Choosing a file will fill the name of that file into the text
-               field next to the button.
-               You must also check the box affirming that you are not
-               violating any copyrights by uploading the file.
-               Press the \"Upload\" button to finish the upload.
-               This may take some time if you have a slow internet connection.
-               <p>The preferred formats are JPEG for photographic images, PNG
-               for drawings and other iconic images, and OGG for sounds.
-               Please name your files descriptively to avoid confusion.
-               To include the image in an article, use a link in the form
-               <b>[[{{ns:6}}:file.jpg]]</b> or <b>[[{{ns:6}}:file.png|alt text]]</b>
-               or <b>[[{{ns:-2}}:file.ogg]]</b> for sounds.
-               <p>Please note that as with wiki pages, others may edit or
-               delete your uploads if they think it serves the encyclopedia, and
-               you may be blocked from uploading if you abuse the system.",
-
                "uploadlog"             => "upload log",
                "uploadlogpage" => "Upload_log",
                "uploadlogpagetext" => "Below is a list of the most recent file uploads.
@@ -828,8 +807,8 @@ require_once("LanguageUtf8.php");
                "protectlogpage" => "Protection_log",
                "protectlogtext" => "Below is a list of page locks/unlocks.
                See [[{{ns:4}}:Protected page]] for more information.",
-               "protectedarticle" => "protected [[$1]]",
-               "unprotectedarticle" => "unprotected [[$1]]",
+               "protectedarticle" => "protected $1",
+               "unprotectedarticle" => "unprotected $1",
                "protectsub" =>"(Protecting \"$1\")",
                "confirmprotecttext" => "Do you really want to protect this page?",
                "confirmprotect" => "Confirm protection",
@@ -1163,60 +1142,36 @@ class LanguageAr extends LanguageUtf8 {
                "," => "٬"
        );
 
-       # TODO: TRANSLATION!
-
-       # Inherit everything except...
-
-       function getNamespaces()
-       {
+       function getNamespaces() {
                global $wgNamespaceNamesAr;
                return $wgNamespaceNamesAr;
        }
 
-
-       function getNsText( $index )
-       {
+       function getNsText( $index ) {
                global $wgNamespaceNamesAr;
                return $wgNamespaceNamesAr[$index];
        }
 
-       function getNsIndex( $text )
-       {
+       function getNsIndex( $text ) {
                global $wgNamespaceNamesAr;
 
-               foreach ( $wgNamespaceNamesAr as $i => $n )
-               {
+               foreach ( $wgNamespaceNamesAr as $i => $n ) {
                        if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
                }
                return LanguageUtf8::getNsIndex( $text );
        }
 
-       function getMonthName( $key )
-       {
-               global $wgMonthNamesAr;
-               return $wgMonthNamesAr[$key-1];
-       }
-
-       function getMonthAbbreviation( $key )
-       {
+       function getMonthAbbreviation( $key ) {
                /* No abbreviations in Arabic */
                return $this->getMonthName( $key );
        }
 
-       function getWeekdayName( $key )
-       {
-               global $wgWeekdayNamesAr;
-               return $wgWeekdayNamesAr[$key-1];
-       }
-
-
        function isRTL() { return true; }
 
        function linkPrefixExtension() { return true; }
 
-       function getDefaultUserOptions () {
-               global $wgDefaultUserOptionsEn;
-               $opt = $wgDefaultUserOptionsEn;
+       function getDefaultUserOptions() {
+               $opt = parent::getDefaultUserOptions();
 
                # Swap sidebar to right side by default
                $opt['quickbar'] = 2;
@@ -1226,31 +1181,25 @@ class LanguageAr extends LanguageUtf8 {
                return $opt ;
        }
 
-       function checkTitleEncoding( $s ) {
-               global $wgInputEncoding;
-
-               # Check for non-UTF-8 URLs; assume they are windows-1256?
-               $ishigh = preg_match( '/[\x80-\xff]/', $s);
-               $isutf = ($ishigh ? preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
-                '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true );
-
-               if( $ishigh and !$isutf )
-                       return iconv( "windows-1256", "utf-8", $s );
-
-               return $s;
+       function fallback8bitEncoding() {
+               return "windows-1256";
        }
 
-       function getMessage( $key )
-       {
-                global $wgAllMessagesAr, $wgAllMessagesEn;
-                $m = $wgAllMessagesAr[$key];
+       function getMessage( $key ) {
+               global $wgAllMessagesAr, $wgAllMessagesEn;
+               $m = $wgAllMessagesAr[$key];
 
-                if ( "" == $m ) { return $wgAllMessagesEn[$key]; }
-                else return $m;
+               if ( "" == $m ) { return $wgAllMessagesEn[$key]; }
+               else return $m;
        }
 
        function formatNum( $number ) {
-               return strtr( $number, $this->digitTransTable );
+               global $wgTranslateNumerals;
+               if( $wgTranslateNumerals ) {
+                       return strtr( $number, $this->digitTransTable );
+               } else {
+                       return $number;
+               }
        }
 }