Merge "objectcache: update MemcachedPeclBagOStuff for pecl memcached 3.0.0" into...
[lhc/web/wiklou.git] / languages / classes / LanguageSl.php
index e8f9456..25fc963 100644 (file)
@@ -1,93 +1,59 @@
 <?php
-/** Slovenian (Slovenščina)
+/**
+ * Slovenian (Slovenščina) specific code.
  *
- * @addtogroup Language
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Language
+ */
+
+/**
+ * Slovenian (Slovenščina)
+ *
+ * @ingroup Language
  */
 class LanguageSl extends Language {
        # Convert from the nominative form of a noun to some other case
        # Invoked with {{GRAMMAR:case|word}}
        /**
         * Cases: rodilnik, dajalnik, tožilnik, mestnik, orodnik
+        *
+        * @param string $word
+        * @param string $case
+        *
+        * @return string
         */
        function convertGrammar( $word, $case ) {
                global $wgGrammarForms;
-               if ( isset($wgGrammarForms['sl'][$case][$word]) ) {
+               if ( isset( $wgGrammarForms['sl'][$case][$word] ) ) {
                        return $wgGrammarForms['sl'][$case][$word];
                }
 
                switch ( $case ) {
-                       case 'rodilnik': # genitive
-                               switch ( $word ) {
-                                       case 'Wikipedija': $word = 'Wikipedije'; break 2;
-                                       case 'Wikiknjige': $word = 'Wikiknjig'; break 2;
-                                       case 'Wikinovice': $word = 'Wikinovic'; break 2;
-                                       case 'Wikinavedek': $word = 'Wikinavedka'; break 2;
-                                       case 'Wikivir': $word = 'Wikivira'; break 2;
-                                       case 'Wikislovar': $word = 'Wikislovarja'; break 2;
-                               }
-                       case 'dajalnik': # dativ
-                               switch ( $word ) {
-                                       case 'Wikipedija': $word = 'Wikipediji'; break 2;
-                                       case 'Wikiknjige': $word = 'Wikiknjigam'; break 2;
-                                       case 'Wikinovice': $word = 'Wikinovicam'; break 2;
-                                       case 'Wikinavedek': $word = 'Wikinavedku'; break 2;
-                                       case 'Wikivir': $word = 'Wikiviru'; break 2;
-                                       case 'Wikislovar': $word = 'Wikislovarju'; break 2;
-                               }
-                       case 'tožilnik': # akuzatív
-                               switch ( $word ) {
-                                       case 'Wikipedija': $word = 'Wikipedijo'; break 2;
-                                       case 'Wikiknjige':
-                                       case 'Wikinovice':
-                                       case 'Wikinavedek':
-                                       case 'Wikivir':
-                                       case 'Wikislovar':
-                                               // Don't change, just fall through
-                                               break 2;
-                               }
                        case 'mestnik': # locative
-                               switch ( $word ) {
-                                       case 'Wikipedija': $word = 'o Wikipediji'; break 2;
-                                       case 'Wikiknjige': $word = 'o Wikiknjigah'; break 2;
-                                       case 'Wikinovice': $word = 'o Wikinovicah'; break 2;
-                                       case 'Wikinavedek': $word = 'o Wikinavedku'; break 2;
-                                       case 'Wikivir': $word = 'o Wikiviru'; break 2;
-                                       case 'Wikislovar': $word = 'o Wikislovarju'; break 2;
-                                       default: $word = 'o ' . $word; break 2;
-                               }
+                               $word = 'o ' . $word;
+                               break;
                        case 'orodnik': # instrumental
-                               switch ( $word ) {
-                                       case 'Wikipedija': $word = 'z Wikipedijo'; break 2;
-                                       case 'Wikiknjige': $word = 'z Wikiknjigami'; break 2;
-                                       case 'Wikinovice': $word = 'z Wikinovicami'; break 2;
-                                       case 'Wikinavedek': $word = 'z Wikinavedkom'; break 2;
-                                       case 'Wikivir': $word = 'z Wikivirom'; break 2;
-                                       case 'Wikislovar': $word = 'z Wikislovarjem'; break 2;
-                                       default: $word = 'z ' . $word;
-                               }
+                               $word = 'z ' . $word;
+                               break;
                }
 
-               return $word; # this will return the original value for 'imenovalnik' (nominativ) and all undefined case values
+               # this will return the original value for 'imenovalnik' (nominativ) and
+               # all undefined case values.
+               return $word;
        }
-
-       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];
-       }
-
-
 }
-?>