summaryrefslogtreecommitdiff
path: root/languages/LanguageGsw.php
blob: 72dd713bbdb31187ae89079b3af479f71e86820c (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
115
<?php
/** Alemannic (Alemannisch)
 *
 * @package MediaWiki
 * @subpackage Language
 */

/*
<Melancholie> for the moment it would be the best if LanguageAls.php would be
              the same like LanguageDe.php. That would help us a lot at als.
<Melancholie> at the moment all is in English
<TimStarling> ok
<Melancholie> great
<TimStarling> I'll make a stub language file that fetches everything from de
<Melancholie> cool
*/

include_once( "LanguageDe.php" );

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

class LanguageGsw extends LanguageDe {
	private $mMessagesGsw = null;

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

		global $wgAllMessagesGsw;
		$this->mMessagesGsw =& $wgAllMessagesGsw;

	}

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

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

	function getFallbackLanguage() {
		return 'de';
	}

	function linkTrail() {
		return '/^([äöüßa-z]+)(.*)$/sDu';
	}

   # Convert from the nominative form of a noun to some other case
   # Invoked with result

   function convertGrammar( $word, $case ) {
       global $wgGrammarForms;
       if ( isset($wgGrammarForms['gsw'][$case][$word]) ) {
           return $wgGrammarForms['gsw'][$case][$word];
       }
       switch ( $case ) {
           case 'dativ':
               if ( $word == 'Wikipedia' ) {
                   $word = 'vo de Wikipedia';
               } elseif ( $word == 'Wikinorchrichte' ) {
                   $word = 'vo de Wikinochrichte';
               } elseif ( $word == 'Wiktionaire' ) {
                   $word = 'vom Wiktionaire';
               } elseif ( $word == 'Wikibuecher' ) {
                   $word = 'vo de Wikibuecher';
               } elseif ( $word == 'Wikisprüch' ) {
                   $word = 'vo de Wikisprüch';
               } elseif ( $word == 'Wikiquälle' ) {
                   $word = 'vo de Wikiquälle';
               }
               break;
           case 'akkusativ':
               if ( $word == 'Wikipedia' ) {
                   $word = 'd Wikipedia';
               } elseif ( $word == 'Wikinorchrichte' ) {
                   $word = 'd Wikinochrichte';
               } elseif ( $word == 'Wiktionaire' ) {
                   $word = 's Wiktionaire';
               } elseif ( $word == 'Wikibuecher' ) {
                   $word = 'd Wikibuecher';
               } elseif ( $word == 'Wikisprüch' ) {
                   $word = 'd Wikisprüch';
               } elseif ( $word == 'Wikiquälle' ) {
                   $word = 'd Wikiquälle';
               }
               break;
           case 'nominativ':
               if ( $word == 'Wikipedia' ) {
                   $word = 'd Wikipedia';
               } elseif ( $word == 'Wikinorchrichte' ) {
                   $word = 'd Wikinochrichte';
               } elseif ( $word == 'Wiktionaire' ) {
                   $word = 's Wiktionaire';
               } elseif ( $word == 'Wikibuecher' ) {
                   $word = 'd Wikibuecher';
               } elseif ( $word == 'Wikisprüch' ) {
                   $word = 'd Wikisprüch';
               } elseif ( $word == 'Wikiquälle' ) {
                   $word = 'd Wikiquälle';
               }
               break;
       } 
       return $word;
   }

}

?>