dc3fc0f291dabc4118047f7667c4758ae863c665
[lhc/web/wiklou.git] / languages / LanguageNn.php
1 <?php
2 /** Norwegian (Nynorsk)
3 *
4 * @license http://www.gnu.org/copyleft/fdl.html GNU Free Documentation License
5 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
6 *
7 * @author Olve Utne
8 * @author Guttorm Flatabø
9 * @link http://meta.wikimedia.org/w/index.php?title=LanguageNn.php&action=history
10 * @link http://nn.wikipedia.org/w/index.php?title=Brukar:Dittaeva/LanguageNn.php&action=history
11 *
12 * @package MediaWiki
13 * @subpackage Language
14 */
15
16 require_once( 'LanguageUtf8.php' );
17
18 if (!$wgCachedMessageArrays) {
19 require_once('MessagesNn.php');
20 }
21
22 class LanguageNn extends LanguageUtf8 {
23 private $mMessagesNn, $mNamespaceNamesNn = null;
24
25 private $mQuickbarSettingsNn = array(
26 'Ingen', 'Venstre', 'Høgre', 'Flytande venstre', 'Flytande høgre'
27 );
28
29 private $mSkinNamesNn = array(
30 'standard' => 'Klassisk',
31 'nostalgia' => 'Nostalgi',
32 'cologneblue' => 'Kölnerblå',
33 'myskin' => 'MiDrakt'
34 );
35
36 private $mDateFormatsNn = array(
37 'Standard',
38 '15. januar 2001 kl. 16:12',
39 '15. jan. 2001 kl. 16:12',
40 '16:12, 15. januar 2001',
41 '16:12, 15. jan. 2001',
42 'ISO 8601' => '2001-01-15 16:12:34'
43 );
44
45 private $mBookstoreListNn = array(
46 'Bibsys' => 'http://ask.bibsys.no/ask/action/result?kilde=biblio&fid=isbn&lang=nn&term=$1',
47 'BokBerit' => 'http://www.bokberit.no/annet_sted/bocker/$1.html',
48 'Bokkilden' => 'http://www.bokkilden.no/ProductDetails.aspx?ProductId=$1',
49 'Haugenbok' => 'http://www.haugenbok.no/resultat.cfm?st=hurtig&isbn=$1',
50 'Akademika' => 'http://www.akademika.no/sok.php?isbn=$1',
51 'Gnist' => 'http://www.gnist.no/sok.php?isbn=$1',
52 'Amazon.co.uk' => 'http://www.amazon.co.uk/exec/obidos/ISBN=$1',
53 'Amazon.de' => 'http://www.amazon.de/exec/obidos/ISBN=$1',
54 'Amazon.com' => 'http://www.amazon.com/exec/obidos/ISBN=$1'
55 );
56
57 # Note to translators:
58 # Please include the English words as synonyms. This allows people
59 # from other wikis to contribute more easily.
60 #
61 private $mMagicWordsNn = array(
62 # ID CASE SYNONYMS
63 'redirect' => array( 0, '#redirect', '#omdiriger' ),
64 'notoc' => array( 0, '__NOTOC__', '__INGAINNHALDSLISTE__', '__INGENINNHOLDSLISTE__' ),
65 'forcetoc' => array( 0, '__FORCETOC__', '__ALLTIDINNHALDSLISTE__', '__ALLTIDINNHOLDSLISTE__' ),
66 'toc' => array( 0, '__TOC__', '__INNHALDSLISTE__', '__INNHOLDSLISTE__' ),
67 'noeditsection' => array( 0, '__NOEDITSECTION__', '__INGABOLKENDRING__', '__INGABOLKREDIGERING__', '__INGENDELENDRING__'),
68 'currentmonth' => array( 1, 'CURRENTMONTH', 'MÅNADNO', 'MÅNEDNÅ' ),
69 'currentmonthname' => array( 1, 'CURRENTMONTHNAME', 'MÅNADNONAMN', 'MÅNEDNÅNAVN' ),
70 'currentmonthabbrev' => array( 1, 'CURRENTMONTHABBREV', 'MÅNADNOKORT', 'MÅNEDNÅKORT' ),
71 'currentday' => array( 1, 'CURRENTDAY', 'DAGNO', 'DAGNÅ' ),
72 'currentdayname' => array( 1, 'CURRENTDAYNAME', 'DAGNONAMN', 'DAGNÅNAVN' ),
73 'currentyear' => array( 1, 'CURRENTYEAR', 'ÅRNO', 'ÅRNÅ' ),
74 'currenttime' => array( 1, 'CURRENTTIME', 'TIDNO', 'TIDNÅ' ),
75 'numberofarticles' => array( 1, 'NUMBEROFARTICLES', 'INNHALDSSIDETAL', 'INNHOLDSSIDETALL' ),
76 'numberoffiles' => array( 1, 'NUMBEROFFILES', 'FILTAL' ),
77 'pagename' => array( 1, 'PAGENAME', 'SIDENAMN', 'SIDENAVN' ),
78 'pagenamee' => array( 1, 'PAGENAMEE', 'SIDENAMNE', 'SIDENAVNE' ),
79 'namespace' => array( 1, 'NAMESPACE', 'NAMNEROM', 'NAVNEROM' ),
80 'subst' => array( 0, 'SUBST:', 'LIMINN:' ),
81 'msgnw' => array( 0, 'MSGNW:', 'IKWIKMELD:' ),
82 'end' => array( 0, '__END__', '__SLUTT__' ),
83 'img_thumbnail' => array( 1, 'thumbnail', 'thumb', 'mini', 'miniatyr' ),
84 'img_manualthumb' => array( 1, 'thumbnail=$1', 'thumb=$1', 'mini=$1', 'miniatyr=$1' ),
85 'img_right' => array( 1, 'right', 'høgre', 'høyre' ),
86 'img_left' => array( 1, 'left', 'venstre' ),
87 'img_none' => array( 1, 'none', 'ingen' ),
88 'img_width' => array( 1, '$1px', '$1pk' ),
89 'img_center' => array( 1, 'center', 'centre', 'sentrum' ),
90 'img_framed' => array( 1, 'framed', 'enframed', 'frame', 'ramme' ),
91 'sitename' => array( 1, 'SITENAME', 'NETTSTADNAMN' ),
92 'ns' => array( 0, 'NS:', 'NR:' ),
93 'localurl' => array( 0, 'LOCALURL:', 'LOKALLENKJE:', 'LOKALLENKE:' ),
94 'localurle' => array( 0, 'LOCALURLE:', 'LOKALLENKJEE:', 'LOKALLENKEE:' ),
95 'server' => array( 0, 'SERVER', 'TENAR', 'TJENER' ),
96 'servername' => array( 0, 'SERVERNAME', 'TENARNAMN', 'TJENERNAVN' ),
97 'scriptpath' => array( 0, 'SCRIPTPATH', 'SKRIPTSTI' ),
98 'grammar' => array( 0, 'GRAMMAR:', 'GRAMMATIKK:' ),
99 'notitleconvert' => array( 0, '__NOTITLECONVERT__', '__NOTC__' ),
100 'nocontentconvert' => array( 0, '__NOCONTENTCONVERT__', '__NOCC__' ),
101 'currentweek' => array( 1, 'CURRENTWEEK', 'VEKENRNO', 'UKENRNÅ' ),
102 'currentdow' => array( 1, 'CURRENTDOW', 'VEKEDAGNRNO', 'UKEDAGNRNÅ' ),
103 'revisionid' => array( 1, 'REVISIONID', 'VERSJONSID' )
104 );
105
106 function __construct() {
107 parent::__construct();
108
109 global $wgAllMessagesNn;
110 $this->mMessagesNn =& $wgAllMessagesNn;
111
112 global $wgMetaNamespace;
113 $this->mNamespaceNamesNn = array(
114 NS_MEDIA => 'Filpeikar',
115 NS_SPECIAL => 'Spesial',
116 NS_MAIN => '',
117 NS_TALK => 'Diskusjon',
118 NS_USER => 'Brukar',
119 NS_USER_TALK => 'Brukardiskusjon',
120 NS_PROJECT => $wgMetaNamespace,
121 NS_PROJECT_TALK => $wgMetaNamespace . '-diskusjon',
122 NS_IMAGE => 'Fil',
123 NS_IMAGE_TALK => 'Fildiskusjon',
124 NS_MEDIAWIKI => 'MediaWiki',
125 NS_MEDIAWIKI_TALK => 'MediaWiki-diskusjon',
126 NS_TEMPLATE => 'Mal',
127 NS_TEMPLATE_TALK => 'Maldiskusjon',
128 NS_HELP => 'Hjelp',
129 NS_HELP_TALK => 'Hjelpdiskusjon',
130 NS_CATEGORY => 'Kategori',
131 NS_CATEGORY_TALK => 'Kategoridiskusjon'
132 );
133
134 }
135
136 function getNamespaces() {
137 return $this->mNamespaceNamesNn + parent::getNamespaces();
138 }
139
140 function getQuickbarSettings() {
141 return $this->mQuickbarSettingsNn;
142 }
143
144 function getSkinNames() {
145 return $this->mSkinNamesNn + parent::getSkinNames();
146 }
147
148 function getDateFormats() {
149 return $this->mDateFormatsNn;
150 }
151
152 function getBookstoreList() {
153 return $this->mBookstoreListNn;
154 }
155
156 function &getMagicWords() {
157 $t = $this->mMagicWordsNn + parent::getMagicWords();
158 return $t;
159 }
160
161 function getMessage( $key ) {
162 if( isset( $this->mMessagesNn[$key] ) ) {
163 return $this->mMessagesNn[$key];
164 } else {
165 return parent::getMessage( $key );
166 }
167 }
168
169 function getAllMessages() {
170 return $this->mMessagesNn;
171 }
172
173
174 /**
175 * $timecorrection is for compatibility with language::time
176 */
177 function time($ts, $adj = false, $format = true, $timecorrection = false) {
178 if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting.
179
180 $format = $this->dateFormat($format);
181
182 switch( $format ) {
183 # 2001-01-15 16:12:34
184 case 'ISO 8601': return substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 ) . ':' . substr( $ts, 12, 2 );
185 default: return substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 );
186 }
187
188 }
189
190 /**
191 * $timecorrection is for compatibility with Language::date
192 */
193 function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
194 global $wgUser;
195 if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting.
196 $format = $this->dateFormat($format);
197
198 switch( $format ) {
199 # 15. jan. 2001 kl. 16:12 || 16:12, 15. jan. 2001
200 case '2': case '4': return (0 + substr( $ts, 6, 2 )) . '. ' .
201 $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . '. ' .
202 substr($ts, 0, 4);
203 # 2001-01-15 16:12:34
204 case 'ISO 8601': return substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
205
206 # 15. januar 2001 kl. 16:12 || 16:12, 15. januar 2001
207 default: return (0 + substr( $ts, 6, 2 )) . '. ' .
208 $this->getMonthName( substr( $ts, 4, 2 ) ) . ' ' .
209 substr($ts, 0, 4);
210 }
211
212 }
213
214 /**
215 * $format and $timecorrection are for compatibility with Language::date
216 */
217 function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) {
218 global $wgUser;
219
220 $format = $this->dateFormat($format);
221
222 switch ( $format ) {
223 # 16:12, 15. januar 2001 || 16:12, 15. jan. 2001
224 case '3': case '4': return $this->time( $ts, $adj, $format ) . ', ' . $this->date( $ts, $adj, $format );
225 # 2001-01-15 16:12:34
226 case 'ISO 8601': return $this->date( $ts, $adj, $format ) . ' ' . $this->time( $ts, $adj, $format );
227 # 15. januar 2001 kl. 16:12 || 15. jan. 2001 kl. 16:12
228 default: return $this->date( $ts, $adj, $format ) . ' kl. ' . $this->time( $ts, $adj, $format );
229 }
230
231 }
232
233 function separatorTransformTable() {
234 return array(
235 ',' => "\xc2\xa0",
236 '.' => ','
237 );
238 }
239
240 }
241
242 ?>