]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - languages/classes/LanguageBs.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / languages / classes / LanguageBs.php
index 119280e69013bd778c5549b4270e6806ef82d5fb..de9c7dcec45d5cc8d3875d5d04d0632e82b80ce8 100644 (file)
 <?php
-/** Bosnian (bosanski)
-  *
-  * @addtogroup Language
-  */
+/**
+ * Bosnian (bosanski) specific code.
+ *
+ * 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
+ */
 
+/**
+ * Bosnian (bosanski)
+ *
+ * @ingroup Language
+ */
 class LanguageBs extends Language {
-
-       function convertPlural( $count, $wordform1, $wordform2, $wordform3, $w4, $w5) {
-               $count = str_replace ('.', '', $count);
-               if ($count > 10 && floor(($count % 100) / 10) == 1) {
-                       return $wordform3;
-               } else {
-                       switch ($count % 10) {
-                               case 1: return $wordform1;
-                               case 2:
-                               case 3:
-                               case 4: return $wordform2;
-                               default: return $wordform3;
-                       }
-               }
-       }
-
-       # Convert from the nominative form of a noun to some other case
-       # Invoked with {{GRAMMAR:case|word}}
        /**
+        * Convert from the nominative form of a noun to some other case
+        * Invoked with {{GRAMMAR:case|word}}
+        *
         * Cases: genitiv, dativ, akuzativ, vokativ, instrumental, lokativ
+        *
+        * @param string $word
+        * @param string $case
+        *
+        * @return string
         */
        function convertGrammar( $word, $case ) {
                global $wgGrammarForms;
-               if ( isset($wgGrammarForms['bs'][$case][$word]) ) {
+               if ( isset( $wgGrammarForms['bs'][$case][$word] ) ) {
                        return $wgGrammarForms['bs'][$case][$word];
                }
                switch ( $case ) {
-                       case 'genitiv': # genitive
-                               if ( $word == 'Wikipedia' ) {
-                                       $word = 'Wikipedije';
-                               } elseif ( $word == 'Wikiknjige' ) {
-                                       $word = 'Wikiknjiga';
-                               } elseif ( $word == 'Wikivijesti' ) {
-                                       $word = 'Wikivijesti';
-                               } elseif ( $word == 'Wikicitati' ) {
-                                       $word = 'Wikicitata';
-                               } elseif ( $word == 'Wikiizvor' ) {
-                                       $word = 'Wikiizvora';
-                               } elseif ( $word == 'Vikirječnik' ) {
-                                       $word = 'Vikirječnika';
-                               }
-                       break;
-                       case 'dativ': # dative
-                               if ( $word == 'Wikipedia' ) {
-                                       $word = 'Wikipediji';
-                               } elseif ( $word == 'Wikiknjige' ) {
-                                       $word = 'Wikiknjigama';
-                               } elseif ( $word == 'Wikicitati' ) {
-                                       $word = 'Wikicitatima';
-                               } elseif ( $word == 'Wikivijesti' ) {
-                                       $word = 'Wikivijestima';
-                               } elseif ( $word == 'Wikiizvor' ) {
-                                       $word = 'Wikiizvoru';
-                               } elseif ( $word == 'Vikirječnik' ) {
-                                       $word = 'Vikirječniku';
-                               }
-                       break;
-                       case 'akuzativ': # akusative
-                               if ( $word == 'Wikipedia' ) {
-                                       $word = 'Wikipediju';
-                               } elseif ( $word == 'Wikiknjige' ) {
-                                       $word = 'Wikiknjige';
-                               } elseif ( $word == 'Wikicitati' ) {
-                                       $word = 'Wikicitate';
-                               } elseif ( $word == 'Wikivijesti' ) {
-                                       $word = 'Wikivijesti';
-                               } elseif ( $word == 'Wikiizvor' ) {
-                                       $word = 'Wikiizvora';
-                               } elseif ( $word == 'Vikirječnik' ) {
-                                       $word = 'Vikirječnika';
-                               }
-                       break;
-                       case 'vokativ': # vocative
-                               if ( $word == 'Wikipedia' ) {
-                                       $word = 'Wikipedijo';
-                               } elseif ( $word == 'Wikiknjige' ) {
-                                       $word = 'Wikiknjige';
-                               } elseif ( $word == 'Wikicitati' ) {
-                                       $word = 'Wikicitati';
-                               } elseif ( $word == 'Wikivijesti' ) {
-                                       $word = 'Wikivijesti';
-                               } elseif ( $word == 'Wikiizvor' ) {
-                                       $word = 'Wikizivoru';
-                               } elseif ( $word == 'Vikirječnik' ) {
-                                       $word = 'Vikirječniče';
-                               }
-                       break;
                        case 'instrumental': # instrumental
-                               if ( $word == 'Wikipedia' ) {
-                                       $word = 's Wikipediom';
-                               } elseif ( $word == 'Wikiknjige' ) {
-                                       $word = 's Wikiknjigama';
-                               } elseif ( $word == 'Wikicitati' ) {
-                                       $word = 's Wikicitatima';
-                               } elseif ( $word == 'Wikivijesti' ) {
-                                       $word = 's Wikivijestima';
-                               } elseif ( $word == 'Wikiizvor' ) {
-                                       $word = 's Wikiizvorom';
-                               } elseif ( $word == 'Vikirječnik' ) {
-                                       $word = 's Vikirječnikom';
-                               } else {
-                                       $word = 's ' . $word;
-                               }
+                               $word = 's ' . $word;
                        break;
                        case 'lokativ': # locative
-                               if ( $word == 'Wikipedia' ) {
-                                       $word = 'o Wikipediji';
-                               } elseif ( $word == 'Wikiknjige' ) {
-                                       $word = 'o Wikiknjigama';
-                               } elseif ( $word == 'Wikicitati' ) {
-                                       $word = 'o Wikicitatima';
-                               } elseif ( $word == 'Wikivijesti' ) {
-                                       $word = 'o Wikivijestima';
-                               } elseif ( $word == 'Wikiizvor' ) {
-                                       $word = 'o Wikiizvoru';
-                               } elseif ( $word == 'Vikirječnik' ) {
-                                       $word = 'o Vikirječniku';
-                               } else {
-                                       $word = 'o ' . $word;
-                               }
+                               $word = 'o ' . $word;
                        break;
                }
 
-               return $word; # this will return the original value for 'nominativ' (nominative) and all undefined case values
+               # this will return the original value for 'nominativ' (nominative)
+               # and all undefined case values.
+               return $word;
        }
-
 }
-
-