Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org...
[lhc/web/wiklou.git] / languages / classes / LanguageSh.php
1 <?php
2 /**
3 * Serbo-Croatian (Srpskohrvatski / Српскохрватски)
4 *
5 * @ingroup Language
6 */
7 class LanguageSh extends Language {
8 function convertPlural( $count, $forms ) {
9 if ( !count( $forms ) ) { return ''; }
10
11 // if no number with word, then use $form[0] for singular and $form[1] for plural or zero
12 if ( count( $forms ) === 2 ) return $count == 1 ? $forms[0] : $forms[1];
13
14 // @todo FIXME: CLDR defines 4 plural forms. Form with decimals missing.
15 // See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#sh
16 $forms = $this->preConvertPlural( $forms, 3 );
17
18 if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
19 return $forms[2];
20 } else {
21 switch ( $count % 10 ) {
22 case 1: return $forms[0];
23 case 2:
24 case 3:
25 case 4: return $forms[1];
26 default: return $forms[2];
27 }
28 }
29 }
30 }