]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - languages/classes/LanguageSl.php
MediaWiki 1.17.0
[autoinstalls/mediawiki.git] / languages / classes / LanguageSl.php
1 <?php
2
3 /** Slovenian (Slovenščina)
4  *
5  * @ingroup Language
6  */
7 class LanguageSl extends Language {
8         # Convert from the nominative form of a noun to some other case
9         # Invoked with {{GRAMMAR:case|word}}
10         /**
11          * Cases: rodilnik, dajalnik, tožilnik, mestnik, orodnik
12          */
13         function convertGrammar( $word, $case ) {
14                 global $wgGrammarForms;
15                 if ( isset( $wgGrammarForms['sl'][$case][$word] ) ) {
16                         return $wgGrammarForms['sl'][$case][$word];
17                 }
18
19                 switch ( $case ) {
20                         case 'mestnik': # locative
21                                 $word = 'o ' . $word; break;
22                         case 'orodnik': # instrumental
23                                 $word = 'z ' . $word;
24                 }
25
26                 return $word; # this will return the original value for 'imenovalnik' (nominativ) and all undefined case values
27         }
28
29         function convertPlural( $count, $forms ) {
30                 if ( !count( $forms ) ) { return ''; }
31                 $forms = $this->preConvertPlural( $forms, 5 );
32
33                 if ( $count % 100 == 1 ) {
34                         $index = 0;
35                 } elseif ( $count % 100 == 2 ) {
36                         $index = 1;
37                 } elseif ( $count % 100 == 3 || $count % 100 == 4 ) {
38                         $index = 2;
39                 } elseif ( $count != 0 ) {
40                         $index = 3;
41                 } else {
42                         $index = 4;
43                 }
44                 return $forms[$index];
45         }
46 }