-<?
-# See language.doc
-include_once("LanguageUtf8.php");
+<?php
+/** Arabic (العربية)
+ *
+ * @package MediaWiki
+ * @subpackage Language
+ */
-/* private */ $wgNamespaceNamesAr = array(
- "-2" => "ملف",
- "-1" => "خاص",
- "0" => "",
- "1" => "نقاش",
- "2" => "مستخدم",
- "3" => "نقاش_المستخدم",
- "4" => "ويكيبيديا",
- "5" => "ويكيبيديا_نقاش",
- "6" => "صورة",
- "7" => "نقاش_الصورة",
- "8" => "MediaWiki",
- "9" => "MediaWiki_talk",
-);
+require_once('LanguageUtf8.php');
-/* private */ $wgWeekdayNamesAr = array(
- "الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس",
- "الجمعة", "السبت"
-);
-
-/* private */ $wgMonthNamesAr = array(
- "يناير", "فبراير", "مارس", "ابريل", "مايو", "يونيو",
- "يوليو", "أغسطس", "سبتمبر", "اكتوبر", "نوفمبر",
- "ديسمبر"
+/* private */ $wgNamespaceNamesAr = 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' => 'سبتمبر',
+'november' => 'نوفمبر',
+'december' => 'ديسمبر',
+
+# Bits of text used by many pages:
+#
+'mainpage' => 'الصفحة الرئيسية',
+'mytalk' => 'صفحة نقاشي',
+'history_short' => 'تاريخ الصفحة',
+'edit' => 'عدل هذه الصفحة',
+'delete' => 'حذف هذه الصفحة',
+'protect' => 'صفحة محمية',
+'talk' => 'ناقش هذه الصفحة',
+
+# Watchlist
+#
+'watch' => 'راقب هذه الصفحة',
+'watchthispage' => 'راقب هذه الصفحة',
+'unwatch' => 'توقف عن مراقبة الصفحة',
+'unwatchthispage' => 'توقف عن مراقبة الصفحة',
);
class LanguageAr extends LanguageUtf8 {
- # TODO: TRANSLATION!
-
- # Inherit everything except...
-
- function getNamespaces()
- {
+ var $digitTransTable = array(
+ '0' => '٠',
+ '1' => '١',
+ '2' => '٢',
+ '3' => '٣',
+ '4' => '٤',
+ '5' => '٥',
+ '6' => '٦',
+ '7' => '٧',
+ '8' => '٨',
+ '9' => '٩',
+ '%' => '٪',
+ '.' => '٫',
+ ',' => '٬'
+ );
+
+ 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 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 formatNum( $number ) {
+ global $wgTranslateNumerals;
+ if( $wgTranslateNumerals ) {
+ return strtr( $number, $this->digitTransTable );
+ } else {
+ return $number;
+ }
+ }
}
?>