MediaWiki  REL1_19
LanguageBs.php
Go to the documentation of this file.
00001 <?php
00002 
00007 class LanguageBs extends Language {
00008 
00014         function convertPlural( $count, $forms ) {
00015                 if ( !count( $forms ) ) { return ''; }
00016                 $forms = $this->preConvertPlural( $forms, 3 );
00017 
00018                 // @todo FIXME: CLDR defines 4 plural forms instead of 3. Plural for decimals is missing.
00019                 //        http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
00020                 if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
00021                         return $forms[2];
00022                 } else {
00023                         switch ( $count % 10 ) {
00024                                 case 1:  return $forms[0];
00025                                 case 2:
00026                                 case 3:
00027                                 case 4:  return $forms[1];
00028                                 default: return $forms[2];
00029                         }
00030                 }
00031         }
00032 
00044         function convertGrammar( $word, $case ) {
00045                 global $wgGrammarForms;
00046                 if ( isset( $wgGrammarForms['bs'][$case][$word] ) ) {
00047                         return $wgGrammarForms['bs'][$case][$word];
00048                 }
00049                 switch ( $case ) {
00050                         case 'instrumental': # instrumental
00051                                 $word = 's ' . $word;
00052                         break;
00053                         case 'lokativ': # locative
00054                                 $word = 'o ' . $word;
00055                         break;
00056                 }
00057 
00058                 return $word; # this will return the original value for 'nominativ' (nominative) and all undefined case values
00059         }
00060 }