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