MediaWiki  REL1_19
LanguageHr.php
Go to the documentation of this file.
00001 <?php
00007 class LanguageHr extends Language {
00008 
00014         function convertPlural( $count, $forms ) {
00015                 if ( !count( $forms ) ) { return ''; }
00016                 // @todo FIXME: CLDR defines 4 plural forms instead of 3. Plural for for decimals is missing.
00017                 //        http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
00018                 $forms = $this->preConvertPlural( $forms, 3 );
00019 
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 }