]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - languages/classes/LanguageBs.php
MediaWiki 1.17.0
[autoinstalls/mediawiki.git] / languages / classes / LanguageBs.php
1 <?php
2
3 /** Bosnian (bosanski)
4  *
5  * @ingroup Language
6  */
7 class LanguageBs extends Language {
8
9         function convertPlural( $count, $forms ) {
10                 if ( !count( $forms ) ) { return ''; }
11                 $forms = $this->preConvertPlural( $forms, 3 );
12
13                 // FIXME: CLDR defines 4 plural forms instead of 3. Plural for decimals is missing.
14                 //        http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
15                 if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
16                         return $forms[2];
17                 } else {
18                         switch ( $count % 10 ) {
19                                 case 1:  return $forms[0];
20                                 case 2:
21                                 case 3:
22                                 case 4:  return $forms[1];
23                                 default: return $forms[2];
24                         }
25                 }
26         }
27
28         # Convert from the nominative form of a noun to some other case
29         # Invoked with {{GRAMMAR:case|word}}
30         /**
31          * Cases: genitiv, dativ, akuzativ, vokativ, instrumental, lokativ
32          */
33         function convertGrammar( $word, $case ) {
34                 global $wgGrammarForms;
35                 if ( isset( $wgGrammarForms['bs'][$case][$word] ) ) {
36                         return $wgGrammarForms['bs'][$case][$word];
37                 }
38                 switch ( $case ) {
39                         case 'instrumental': # instrumental
40                                 $word = 's ' . $word;
41                         break;
42                         case 'lokativ': # locative
43                                 $word = 'o ' . $word;
44                         break;
45                 }
46
47                 return $word; # this will return the original value for 'nominativ' (nominative) and all undefined case values
48         }
49 }