summaryrefslogtreecommitdiff
path: root/languages/LanguageFa.php
blob: 43f5555e3def5fe1f068954acf8f478dcb16b2fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
/** Persian (فارسی)
  *
  * @package MediaWiki
  * @subpackage Language
  */

require_once( 'LanguageUtf8.php' );

if (!$wgCachedMessageArrays) {
	require_once('MessagesFa.php');
}

class LanguageFa extends LanguageUtf8 {
	private $mMessagesFa, $mNamespaceNamesFa = null;

	private $mQuickbarSettingsFa = array(
		'نباشد', 'ثابت چپ', 'ثابت راست', 'شناور چپ'
	);
	
	private $mSkinNamesFa = array(
		'standard' => 'استاندارد',
		'nostalgia' => 'نوستالژی',
		'cologneblue' => 'آبی کلون',
		'smarty' => 'پدینگتون',
		'montparnasse' => 'مون‌پارناس',
	);

	function __construct() {
		parent::__construct();

		global $wgAllMessagesFa;
		$this->mMessagesFa =& $wgAllMessagesFa;

		global $wgMetaNamespace;
		$this->mNamespaceNamesFa = array(
			NS_MEDIA          => 'مدیا',
			NS_SPECIAL        => 'ویژه',
			NS_MAIN	          => '',
			NS_TALK	          => 'بحث',
			NS_USER           => 'کاربر',
			NS_USER_TALK      => 'بحث_کاربر',
			NS_PROJECT        => $wgMetaNamespace,
			NS_PROJECT_TALK   => 'بحث_' . $wgMetaNamespace,
			NS_IMAGE          => 'تصویر',
			NS_IMAGE_TALK     => 'بحث_تصویر',
			NS_MEDIAWIKI      => 'مدیاویکی',
			NS_MEDIAWIKI_TALK	=> 'بحث_مدیاویکی',
			NS_TEMPLATE       => 'الگو',
			NS_TEMPLATE_TALK  => 'بحث_الگو',
			NS_HELP           => 'راهنما',
			NS_HELP_TALK      => 'بحث_راهنما',
			NS_CATEGORY       => 'رده',
			NS_CATEGORY_TALK  => 'بحث_رده'
		);

	}

	function getNamespaces() {
		return $this->mNamespaceNamesFa + parent::getNamespaces();
	}

	function getQuickbarSettings() {
		return $this->mQuickbarSettingsFa;
	}

	function getSkinNames() {
		return $this->mSkinNamesFa + parent::getSkinNames();
	}

	function getMessage( $key ) {
		if( isset( $this->mMessagesFa[$key] ) ) {
			return $this->mMessagesFa[$key];
		} else {
			return parent::getMessage( $key );
		}
	}

	function getAllMessages() {
		return $this->mMessagesFa;
	}

	function digitTransformTable() {
		return array(
			"0" => "۰",
			"1" => "۱",
			"2" => "۲",
			"3" => "۳",
			"4" => "۴",
			"5" => "۵",
			"6" => "۶",
			"7" => "۷",
			"8" => "۸",
			"9" => "۹",
			"%" => "٪",
			"." => "٫", // wrong table?
			"," => "٬"
		);
	}

	function getDefaultUserOptions() {
		$opt = Language::getDefaultUserOptions();
		$opt['quickbar'] = 2;
		$opt['underline'] = 0;
		return $opt;
	}


	# For right-to-left language support
	function isRTL() { return true; }

}
?>