Merge "(bug 37072) - prevents infinite job loop"
[mediawiki.git] / languages / classes / LanguageSl.php
blob3e2ca90e2d6ef1415ba04541aa85afb3247a803c
1 <?php
3 /** Slovenian (Slovenščina)
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
13 * @param $word string
14 * @param $case string
16 * @return string
18 function convertGrammar( $word, $case ) {
19 global $wgGrammarForms;
20 if ( isset( $wgGrammarForms['sl'][$case][$word] ) ) {
21 return $wgGrammarForms['sl'][$case][$word];
24 switch ( $case ) {
25 case 'mestnik': # locative
26 $word = 'o ' . $word; break;
27 case 'orodnik': # instrumental
28 $word = 'z ' . $word;
31 return $word; # this will return the original value for 'imenovalnik' (nominativ) and all undefined case values
34 /**
35 * @param $count int
36 * @param $forms array
38 * @return string
40 function convertPlural( $count, $forms ) {
41 if ( !count( $forms ) ) { return ''; }
42 $forms = $this->preConvertPlural( $forms, 5 );
44 if ( $count % 100 == 1 ) {
45 $index = 0;
46 } elseif ( $count % 100 == 2 ) {
47 $index = 1;
48 } elseif ( $count % 100 == 3 || $count % 100 == 4 ) {
49 $index = 2;
50 } elseif ( $count != 0 ) {
51 $index = 3;
52 } else {
53 $index = 4;
55 return $forms[$index];