Code formatting; clean up redundant method declarations.
[lhc/web/wiklou.git] / languages / LanguageAr.php
index a031c70..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"
-);
-
-/* private */ $wgWeekdayNamesAr = array(
-       "الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس",
-       "الجمعة", "السبت"
-);
-
-/* private */ $wgMonthNamesAr = 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 */ $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\"
@@ -194,7 +205,7 @@ require_once("LanguageUtf8.php");
        "filedeleteerror" => "Could not delete file \"$1\".",
        "filenotfound"  => "Could not find file \"$1\".",
        "unexpected"    => "Unexpected value: \"$1\"=\"$2\".",
-       "formerror"             => "Error: could not submit form",      
+       "formerror"             => "Error: could not submit form",
        "badarticleerror" => "This action cannot be performed on this page.",
        "cannotdelete"  => "Could not delete the page or image specified. (It may have already been deleted by someone else.)",
        "badtitle"              => "Bad title",
@@ -249,7 +260,7 @@ require_once("LanguageUtf8.php");
        "youremail"             => "Your email*",
        "yourrealname"          => "Your real name*",
        "yournick"              => "Your nickname (for signatures)",
-       "emailforlost"  => "Fields marked with a star (*) are optional.  Storing an email address enables people to contact you through the website without you having to reveal your 
+       "emailforlost"  => "Fields marked with a star (*) are optional.  Storing an email address enables people to contact you through the website without you having to reveal your
        email address to them, and it can be used to send you a new password if you forget it.<br /><br />Your real name, if you choose to provide it, will be used for giving you attribution for your work.",
        "loginerror"    => "Login error",
        "nocookiesnew"  => "The user account was created, but you are not logged in. {{SITENAME}} uses cookies to log in users. You have cookies disabled. Please enable them, then log in with your new username and password.",
@@ -329,7 +340,7 @@ require_once("LanguageUtf8.php");
        "newarticle"    => "(New)",
        "newarticletext" =>
        "You've followed a link to a page that doesn't exist yet.
-       To create the page, start typing in the box below 
+       To create the page, start typing in the box below
        (see the [[{{ns:4}}:Help|help page]] for more info).
        If you are here by mistake, just click your browser's '''back''' button.",
        "talkpagetext" => "<!-- MediaWiki:talkpagetext -->",
@@ -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.
@@ -469,7 +478,7 @@ require_once("LanguageUtf8.php");
 
        See [[{{ns:4}}:User preferences help]] for help deciphering the options.",
        "prefsreset"    => "Preferences have been reset from storage.",
-       "qbsettings"    => "Quickbar settings", 
+       "qbsettings"    => "Quickbar settings",
        "changepassword" => "Change password",
        "skin"                  => "Skin",
        "math"                  => "Rendering math",
@@ -488,7 +497,7 @@ require_once("LanguageUtf8.php");
        "oldpassword"   => "Old password",
        "newpassword"   => "New password",
        "retypenew"             => "Retype new password",
-       "textboxsize"   => "Textbox dimensions",
+       "textboxsize"   => "Editing",
        "rows"                  => "Rows",
        "columns"               => "Columns",
        "searchresultshead" => "Search result settings",
@@ -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.
@@ -684,7 +663,7 @@ require_once("LanguageUtf8.php");
                "randompage"    => "Random page",
                "shortpages"    => "Short pages",
                "longpages"             => "Long pages",
-               "deadendpages"  => "Dead-end pages",                                   
+               "deadendpages"  => "Dead-end pages",
                "listusers"             => "User list",
                "specialpages"  => "Special pages",
                "spheading"             => "Special pages for all users",
@@ -728,7 +707,7 @@ require_once("LanguageUtf8.php");
                as the \"From\" address of the mail, so the recipient will be able
                to reply.",
                "usermailererror" => "Mail object returned error: ",
-               "defemailsubject"  => "{{SITENAME}} e-mail",                                   
+               "defemailsubject"  => "{{SITENAME}} e-mail",
                "noemailtitle"  => "No e-mail address",
                "noemailtext"   => "This user has not specified a valid e-mail address,
                or has chosen not to receive e-mail from other users.",
@@ -819,17 +798,17 @@ require_once("LanguageUtf8.php");
                "rollbackfailed" => "Rollback failed",
                "cantrollback"  => "Cannot revert edit; last contributor is only author of this article.",
                "alreadyrolled" => "Cannot rollback last edit of [[$1]]
-               by [[User:$2|$2]] ([[User talk:$2|Talk]]); someone else has edited or rolled back the article already. 
+               by [[User:$2|$2]] ([[User talk:$2|Talk]]); someone else has edited or rolled back the article already.
 
                Last edit was by [[User:$3|$3]] ([[User talk:$3|Talk]]). ",
                #   only shown if there is an edit comment
-               "editcomment" => "The edit comment was: \"<i>$1</i>\".", 
+               "editcomment" => "The edit comment was: \"<i>$1</i>\".",
                "revertpage"    => "Reverted edit of $2, changed back to last version by $1",
                "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",
@@ -909,7 +888,7 @@ require_once("LanguageUtf8.php");
                "autoblocker"   => "Autoblocked because you share an IP address with \"$1\". Reason \"$2\".",
                "blocklogpage"  => "Block_log",
                "blocklogentry" => 'blocked "$1" with an expiry time of $2',
-               "blocklogtext"  => "This is a log of user blocking and unblocking actions. Automatically 
+               "blocklogtext"  => "This is a log of user blocking and unblocking actions. Automatically
                blocked IP addresses are not be listed. See the [[Special:Ipblocklist|IP block list]] for
                the list of currently operational bans and blocks.",
                "unblocklogentry"       => 'unblocked "$1"',
@@ -960,7 +939,7 @@ require_once("LanguageUtf8.php");
 
                # Make sysop
                "makesysoptitle"        => "Make a user into a sysop",
-               "makesysoptext"         => "This form is used by bureaucrats to turn ordinary users into administrators. 
+               "makesysoptext"         => "This form is used by bureaucrats to turn ordinary users into administrators.
                Type the name of the user in the box and press the button to make the user an administrator",
                "makesysopname"         => "Name of the user:",
                "makesysopsubmit"       => "Make this user into a sysop",
@@ -1162,95 +1141,65 @@ 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;
-               
+
                # Underlines seriously harm legibility. Force off:
                $opt['underline'] = 0;
                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];
-
-                if ( "" == $m ) { return $wgAllMessagesEn[$key]; }
-                else return $m;
+
+       function getMessage( $key ) {
+               global $wgAllMessagesAr, $wgAllMessagesEn;
+               $m = $wgAllMessagesAr[$key];
+
+               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;
+               }
        }
 }