(bug 6345) Update to Indonesian localisation (id) #22
[lhc/web/wiklou.git] / languages / LanguageHe.php
1 <?php
2 /**
3 * Hebrew (עברית)
4 *
5 * @package MediaWiki
6 * @subpackage Language
7 *
8 * @author Rotem Dan (July 2003)
9 * @author Rotem Liss (March 2006 on)
10 */
11
12 require_once("LanguageUtf8.php");
13
14 if (!$wgCachedMessageArrays) {
15 require_once('MessagesHe.php');
16 }
17
18 class LanguageHe extends LanguageUtf8 {
19 private $mMessagesHe, $mNamespaceNamesHe = null;
20
21 private $mSkinNamesHe = array(
22 "standard" => "רגיל",
23 "nostalgia" => "נוסטלגי",
24 "cologneblue" => "מים כחולים",
25 "davinci" => "דה־וינצ'י",
26 "simple" => "פשוט",
27 "mono" => "מונו",
28 "monobook" => "מונובוק",
29 "myskin" => "הרקע שלי",
30 "chick" => "צ'יק"
31 );
32
33 private $mQuickbarSettingsHe = array(
34 "ללא", "קבוע משמאל", "קבוע מימין", "צף משמאל", "צף מימין"
35 );
36
37 private $mBookstoreListHe = array(
38 "מיתוס" => "http://www.mitos.co.il/",
39 "iBooks" => "http://www.ibooks.co.il/",
40 "Barnes & Noble" => "http://search.barnesandnoble.com/bookSearch/isbnInquiry.asp?isbn=\$1",
41 "Amazon.com" => "http://www.amazon.com/exec/obidos/ISBN=\$1"
42 );
43
44 /**
45 * Constructor, setting the namespaces
46 */
47 function LanguageHe() {
48 LanguageUtf8::LanguageUtf8();
49
50 global $wgAllMessagesHe;
51 $this->mMessagesHe = &$wgAllMessagesHe;
52
53 global $wgMetaNamespace;
54 $this->mNamespaceNamesHe = array(
55 NS_MEDIA => "מדיה",
56 NS_SPECIAL => "מיוחד",
57 NS_MAIN => "",
58 NS_TALK => "שיחה",
59 NS_USER => "משתמש",
60 NS_USER_TALK => "שיחת_משתמש",
61 NS_PROJECT => $wgMetaNamespace,
62 NS_PROJECT_TALK => "שיחת_" . $wgMetaNamespace,
63 NS_IMAGE => "תמונה",
64 NS_IMAGE_TALK => "שיחת_תמונה",
65 NS_MEDIAWIKI => "מדיה_ויקי",
66 NS_MEDIAWIKI_TALK => "שיחת_מדיה_ויקי",
67 NS_TEMPLATE => "תבנית",
68 NS_TEMPLATE_TALK => "שיחת_תבנית",
69 NS_HELP => "עזרה",
70 NS_HELP_TALK => "שיחת_עזרה",
71 NS_CATEGORY => "קטגוריה",
72 NS_CATEGORY_TALK => "שיחת_קטגוריה",
73 );
74 }
75
76 /**
77 * Changing the default quickbar setting to "2" - right instead of left, as we use RTL interface
78 *
79 * @return array of the default user options
80 */
81 function getDefaultUserOptions() {
82 $opt = parent::getDefaultUserOptions();
83 $opt["quickbar"] = 2;
84 return $opt;
85 }
86
87 /**
88 * @return array of Hebrew bookstore list
89 */
90 function getBookstoreList() {
91 return $this->mBookstoreListHe;
92 }
93
94 /**
95 * @return array of Hebrew namespace names
96 */
97 function getNamespaces() {
98 return $this->mNamespaceNamesHe + parent::getNamespaces();
99 }
100
101 /**
102 * @return array of Hebrew skin names
103 */
104 function getSkinNames() {
105 return $this->mSkinNamesHe + parent::getSkinNames();
106 }
107
108 /**
109 * @return array of Hebrew quickbar settings
110 */
111 function getQuickbarSettings() {
112 return $this->mQuickbarSettingsHe;
113 }
114
115 /**
116 * The function returns a message, in Hebrew if exists, in English if not, only from the default translations here.
117 *
118 * @param string the message key
119 *
120 * @return string of the wanted message
121 */
122 function getMessage( $key ) {
123 if( isset( $this->mMessagesHe[$key] ) ) {
124 return $this->mMessagesHe[$key];
125 } else {
126 return parent::getMessage( $key );
127 }
128 }
129
130 /**
131 * @return array of all the Hebrew messages
132 */
133 function getAllMessages() {
134 return $this->mMessagesHe;
135 }
136
137 /**
138 * @return true, as Hebrew is RTL language
139 */
140 function isRTL() {
141 return true;
142 }
143
144 /**
145 * Gets a number and uses the suited form of the word.
146 *
147 * Needed for Hebrew as some words also has a form for two instances - for example, year or shoe -
148 * and the third parameter is used for them.
149 *
150 * When the word has only signular and plural forms, the plural form will be used for 2.
151 *
152 * @param integer $count
153 * @param string $wordform1
154 * @param string $wordform2
155 * @param string $wordform3 (optional)
156 *
157 * @return string of the suited form of word
158 */
159 function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
160 if ( $count == '1' ) {
161 return $wordform1;
162 } elseif ( $count == '2' && $wordform3 ) {
163 return $wordform3;
164 } else {
165 return $wordform2;
166 }
167 }
168
169 /**
170 * @return string of the best 8-bit encoding for Hebrew, if UTF-8 cannot be used
171 */
172 function fallback8bitEncoding() {
173 return "windows-1255";
174 }
175 }
176
177 ?>