* (bug 6296) Update to Indonesian localisation (id) #21
[lhc/web/wiklou.git] / languages / LanguageSl.php
index 2adaac8..4677de9 100644 (file)
@@ -99,10 +99,13 @@ class LanguageSl extends LanguageUtf8 {
 
        # Convert from the nominative form of a noun to some other case
        # Invoked with {{GRAMMAR:case|word}}
+       /**
+        * Cases: rodilnik, dajalnik, tožilnik, orodnik, mestnik
+        */
        function convertGrammar( $word, $case ) {
                global $wgGrammarForms;
-               if ( isset($wgGrammarForms[$case][$word]) ) {
-                       return $wgGrammarForms[$case][$word];
+               if ( isset($wgGrammarForms['sl'][$case][$word]) ) {
+                       return $wgGrammarForms['sl'][$case][$word];
                }
 
                switch ( $case ) {
@@ -151,7 +154,7 @@ class LanguageSl extends LanguageUtf8 {
                                        $word = 'Wikislovar';
                                }
                        break;
-                       case 'mestnik': # locative
+                       case 'orodnik': # instrumental
                                if ( $word == 'Wikipedija' ) {
                                        $word = 'z Wikipedijo';
                                } elseif ( $word == 'Wikiknjige' ) {
@@ -168,7 +171,7 @@ class LanguageSl extends LanguageUtf8 {
                                        $word = 'z ' . $word;
                                }
                        break;
-                       case 'orodnik': # instrumental
+                       case 'mestnik': # locative
                                if ( $word == 'Wikipedija' ) {
                                        $word = 'o Wikipediji';
                                } elseif ( $word == 'Wikiknjige' ) {
@@ -190,5 +193,23 @@ class LanguageSl extends LanguageUtf8 {
                return $word; # this will return the original value for 'imenovalnik' (nominativ) and all undefined case values
        }
 
+       function convertPlural( $count, $w1, $w2, $w3, $w4, $w5) {
+               $count = str_replace ('.', '', $count);
+               $forms = array( $w1, $w2, $w3, $w4, $w5 );
+               if ( $count % 100 === 1 ) {
+                       $index = 0;
+               } elseif ( $count % 100 === 2 ) {
+                       $index = 1;
+               } elseif ( $count%100==3 || $count%100==4 ) {
+                       $index = 2;
+               } elseif ( $count != 0 ) {
+                       $index = 3;
+               } else {
+                       $index = 4;
+               }
+               return $forms[$index];
+       }
+
+
 }
 ?>
\ No newline at end of file