(bug 29959) Installer fatal when cURL and allow_url_fopen is disabled and user tries...
[mediawiki.git] / languages / classes / LanguageSh.php
blob139ad0b67b0291864399eadb09a4f4599ddfbff3
1 <?php
2 /**
3 * Serbo-Croatian (Srpskohrvatski / Српскохрватски)
5 * @ingroup Language
6 */
7 class LanguageSh extends Language {
9 /**
10 * @param $count string
11 * @param $forms array
12 * @return string
14 function convertPlural( $count, $forms ) {
15 if ( !count( $forms ) ) { return ''; }
17 // if no number with word, then use $form[0] for singular and $form[1] for plural or zero
18 if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
20 // @todo FIXME: CLDR defines 4 plural forms. Form with decimals missing.
21 // See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#sh
22 $forms = $this->preConvertPlural( $forms, 3 );
24 if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
25 return $forms[2];
26 } else {
27 switch ( $count % 10 ) {
28 case 1: return $forms[0];
29 case 2:
30 case 3:
31 case 4: return $forms[1];
32 default: return $forms[2];