00001 <?php
00002
00007 class LanguageBs extends Language {
00008
00009 function convertPlural( $count, $forms ) {
00010 if ( !count($forms) ) { return ''; }
00011 $forms = $this->preConvertPlural( $forms, 3 );
00012
00013 if ($count > 10 && floor(($count % 100) / 10) == 1) {
00014 return $forms[2];
00015 } else {
00016 switch ($count % 10) {
00017 case 1: return $forms[0];
00018 case 2:
00019 case 3:
00020 case 4: return $forms[1];
00021 default: return $forms[2];
00022 }
00023 }
00024 }
00025
00026 # Convert from the nominative form of a noun to some other case
00027 # Invoked with {{GRAMMAR:case|word}}
00028
00031 function convertGrammar( $word, $case ) {
00032 global $wgGrammarForms;
00033 if ( isset($wgGrammarForms['bs'][$case][$word]) ) {
00034 return $wgGrammarForms['bs'][$case][$word];
00035 }
00036 switch ( $case ) {
00037 case 'instrumental': # instrumental
00038 $word = 's ' . $word;
00039 break;
00040 case 'lokativ': # locative
00041 $word = 'o ' . $word;
00042 break;
00043 }
00044
00045 return $word; # this will return the original value for 'nominativ' (nominative) and all undefined case values
00046 }
00047 }