summaryrefslogtreecommitdiff
path: root/languages/LanguageSv.php
blob: 4abb1e03b205daeb08fed06c416e84c79e9de96c (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
114
<?php
/**
 * Swedish (Svenska)
 *
 * @package MediaWiki
 * @subpackage Language
 */

require_once( "LanguageUtf8.php" );

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

class LanguageSv extends LanguageUtf8 {
	private $mMessagesSv, $mNamespaceNamesSv;
	
	private $mQuickbarSettingsSv = array(
		"Ingen",
		"Fast vänster",
		"Fast höger",
		"Flytande vänster"
	);
	
	private $mSkinNamesSv = array(
		'standard' => "Standard",
		'nostalgia' => "Nostalgi",
		'cologneblue' => "Cologne Blå",
	);

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

		global $wgAllMessagesSv;
		$this->mMessagesSv =& $wgAllMessagesSv;

		global $wgMetaNamespace;
		$this->mNamespaceNamesSv = array(
			NS_MEDIA            => "Media",
			NS_SPECIAL          => "Special",
			NS_MAIN	            => "",
			NS_TALK	            => "Diskussion",
			NS_USER             => "Användare",
			NS_USER_TALK        => "Användardiskussion",
			NS_PROJECT	        => $wgMetaNamespace,
			NS_PROJECT_TALK     => $wgMetaNamespace . "diskussion",
			NS_IMAGE            => "Bild",
			NS_IMAGE_TALK       => "Bilddiskussion",
			NS_MEDIAWIKI        => "MediaWiki",
			NS_MEDIAWIKI_TALK   => "MediaWiki_diskussion",
			NS_TEMPLATE         => "Mall",
			NS_TEMPLATE_TALK    => "Malldiskussion",
			NS_HELP             => "Hjälp",
			NS_HELP_TALK        => "Hjälp_diskussion",
			NS_CATEGORY         => "Kategori",
			NS_CATEGORY_TALK    => "Kategoridiskussion"
		);
	}

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

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

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

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

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

	function linkTrail() {
		return '/^([a-zåäöéÅÄÖÉ]+)(.*)$/sDu';
	}


	function separatorTransformTable() {
		return array(
			',' => "\xc2\xa0", // @bug 2749
			'.' => ','
		);
	}

	// "." is used as the character to separate the
	// hours from the minutes in the date output
	function timeSeparator( $format ) {
		return '.';
	}

	function timeanddate( $ts, $adj = false, $format = false, $timecorrection = false ) {
		$format = $this->dateFormat( $format );
		if( $format == MW_DATE_ISO ) {
			return parent::timeanddate( $ts, $adj, $format, $timecorrection );
		} else {
			return $this->date( $ts, $adj, $format, $timecorrection ) .
				" kl." .
				$this->time( $ts, $adj, $format, $timecorrection );
		}
	}

}
?>