Readding parserTests.php and testHelpers.inc with history back to r73884 when they...
[mediawiki.git] / languages / classes / LanguageBs.php
blob6432109d708d751843e1626a2881e767a92002af
1 <?php
3 /** Bosnian (bosanski)
5 * @ingroup Language
6 */
7 class LanguageBs extends Language {
9 function convertPlural( $count, $forms ) {
10 if ( !count( $forms ) ) { return ''; }
11 $forms = $this->preConvertPlural( $forms, 3 );
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];
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
33 function convertGrammar( $word, $case ) {
34 global $wgGrammarForms;
35 if ( isset( $wgGrammarForms['bs'][$case][$word] ) ) {
36 return $wgGrammarForms['bs'][$case][$word];
38 switch ( $case ) {
39 case 'instrumental': # instrumental
40 $word = 's ' . $word;
41 break;
42 case 'lokativ': # locative
43 $word = 'o ' . $word;
44 break;
47 return $word; # this will return the original value for 'nominativ' (nominative) and all undefined case values