Use getInt not getVal
[lhc/web/wiklou.git] / languages / LanguageIs.php
1 <?php
2 /**
3 * @package MediaWiki
4 * @subpackage Language
5 */
6
7 # Most of this was written by Ævar Arnfjörð Bjarmason <avarab@gmail.com>
8
9 require_once( 'LanguageUtf8.php' );
10
11 /* private */ $wgNamespaceNamesIs = array(
12 NS_MEDIA => 'Miðill',
13 NS_SPECIAL => 'Kerfissíða',
14 NS_MAIN => '',
15 NS_TALK => 'Spjall',
16 NS_USER => 'Notandi',
17 NS_USER_TALK => 'Notandaspjall',
18 NS_PROJECT => $wgMetaNamespace,
19 NS_PROJECT_TALK => $wgMetaNamespace . 'spjall',
20 NS_IMAGE => 'Mynd',
21 NS_IMAGE_TALK => 'Myndaspjall',
22 NS_MEDIAWIKI => 'Melding',
23 NS_MEDIAWIKI_TALK => 'Meldingarspjall',
24 NS_TEMPLATE => 'Snið',
25 NS_TEMPLATE_TALK => 'Sniðaspjall',
26 NS_HELP => 'Hjálp',
27 NS_HELP_TALK => 'Hjálparspjall',
28 NS_CATEGORY => 'Flokkur',
29 NS_CATEGORY_TALK => 'Flokkaspjall'
30 ) + $wgNamespaceNamesEn;
31
32 /* private */ $wgQuickbarSettingsIs = array(
33 'Sleppa', 'Fast vinstra megin', 'Fast hægra megin', 'Fljótandi til vinstri'
34 );
35
36 /* private */ $wgSkinNamesIs = array(
37 'standard' => 'Klassískt',
38 'nostalgia' => 'Gamaldags',
39 'cologneblue' => 'Kölnarblátt',
40 'myskin' => 'Mitt þema',
41 ) + $wgSkinNamesEn;
42
43 /* private */ $wgDateFormatsIs = array(
44 'Sjálfgefið',
45 '15. janúar 2001 kl. 16:12',
46 '15. jan. 2001 kl. 16:12',
47 '16:12, 15. janúar 2001',
48 '16:12, 15. jan. 2001',
49 'ISO 8601' => '2001-01-15 16:12:34'
50 );
51
52 $wgMagicWordsIs = array(
53 MAG_REDIRECT => array( 0, '#tilvísun', '#TILVÍSUN', '#redirect' ), // MagicWord::initRegex() sucks
54 ) + $wgMagicWordsEn;
55
56 if (!$wgCachedMessageArrays) {
57 require_once('MessagesIs.php');
58 }
59
60 #--------------------------------------------------------------------------
61 # Internationalisation code
62 #--------------------------------------------------------------------------
63
64 class LanguageIs extends LanguageUtf8 {
65
66 function getNamespaces() {
67 global $wgNamespaceNamesIs;
68 return $wgNamespaceNamesIs;
69 }
70
71 function getQuickbarSettings() {
72 global $wgQuickbarSettingsIs;
73 return $wgQuickbarSettingsIs;
74 }
75
76 function getSkinNames() {
77 global $wgSkinNamesIs;
78 return $wgSkinNamesIs;
79 }
80
81 function getDateFormats() {
82 global $wgDateFormatsIs;
83 return $wgDateFormatsIs;
84 }
85
86 function getMessage( $key ) {
87 global $wgAllMessagesIs;
88 if( isset( $wgAllMessagesIs[$key] ) ) {
89 return $wgAllMessagesIs[$key];
90 } else {
91 return parent::getMessage( $key );
92 }
93 }
94
95 function getAllMessages() {
96 global $wgAllMessagesIs;
97 return $wgAllMessagesIs;
98 }
99
100 function getMagicWords() {
101 global $wgMagicWordsIs;
102 return $wgMagicWordsIs;
103 }
104
105 function date( $ts, $adj = false, $format = true) {
106 global $wgUser;
107 if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting.
108 $format = $this->dateFormat($format);
109
110 switch( $format ) {
111 # 15. jan. 2001 kl. 16:12 || 16:12, 15. jan. 2001
112 case '2': case '4': return (0 + substr( $ts, 6, 2 )) . '. ' .
113 $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . '. ' .
114 substr($ts, 0, 4);
115 # 2001-01-15 16:12:34
116 case 'ISO 8601': return substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
117
118 # 15. janúar 2001 kl. 16:12 || 16:12, 15. janúar 2001
119 default: return (0 + substr( $ts, 6, 2 )) . '. ' .
120 $this->getMonthName( substr( $ts, 4, 2 ) ) . ' ' .
121 substr($ts, 0, 4);
122 }
123
124 }
125
126 function time($ts, $adj = false, $format = true) {
127 global $wgUser;
128 if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting.
129
130 $format = $this->dateFormat($format);
131
132 switch( $format ) {
133 # 2001-01-15 16:12:34
134 case 'ISO 8601': return substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 ) . ':' . substr( $ts, 12, 2 );
135 default: return substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 );
136 }
137
138 }
139
140 function timeanddate( $ts, $adj = false, $format = true) {
141 global $wgUser;
142
143 $format = $this->dateFormat($format);
144
145 switch ( $format ) {
146 # 16:12, 15. janúar 2001 || 16:12, 15. jan. 2001
147 case '3': case '4': return $this->time( $ts, $adj, $format ) . ', ' . $this->date( $ts, $adj, $format );
148 # 2001-01-15 16:12:34
149 case 'ISO 8601': return $this->date( $ts, $adj, $format ) . ' ' . $this->time( $ts, $adj, $format );
150 # 15. janúar 2001 kl. 16:12 || 15. jan. 2001 kl. 16:12
151 default: return $this->date( $ts, $adj, $format ) . ' kl. ' . $this->time( $ts, $adj, $format );
152
153 }
154
155 }
156
157 /**
158 * The Icelandic number style uses dots where English would use commas
159 * and commas where English would use dots, e.g. 201.511,17 not 201,511.17
160 */
161 function formatNum( $number, $year = false ) {
162 return $year ? $number : strtr($this->commafy($number), '.,', ',.' );
163 }
164
165 function linkPrefixExtension() {
166 return true;
167 }
168 }
169
170 ?>