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
00014
00015 if ($count > 10 && floor(($count % 100) / 10) == 1) {
00016 return $forms[2];
00017 } else {
00018 switch ($count % 10) {
00019 case 1: return $forms[0];
00020 case 2:
00021 case 3:
00022 case 4: return $forms[1];
00023 default: return $forms[2];
00024 }
00025 }
00026 }
00027
00028 # Convert from the nominative form of a noun to some other case
00029 # Invoked with {{GRAMMAR:case|word}}
00030
00033 function convertGrammar( $word, $case ) {
00034 global $wgGrammarForms;
00035 if ( isset($wgGrammarForms['bs'][$case][$word]) ) {
00036 return $wgGrammarForms['bs'][$case][$word];
00037 }
00038 switch ( $case ) {
00039 case 'instrumental': # instrumental
00040 $word = 's ' . $word;
00041 break;
00042 case 'lokativ': # locative
00043 $word = 'o ' . $word;
00044 break;
00045 }
00046
00047 return $word; # this will return the original value for 'nominativ' (nominative) and all undefined case values
00048 }
00049 }