2005-09-02 19:21:04 +00:00
|
|
|
<?php
|
2012-06-06 20:42:13 +00:00
|
|
|
/**
|
|
|
|
|
* Croatian (hrvatski) specific code.
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
|
|
|
|
* @file
|
|
|
|
|
* @ingroup Language
|
|
|
|
|
*/
|
2005-09-02 19:21:04 +00:00
|
|
|
|
2012-06-06 20:42:13 +00:00
|
|
|
/**
|
|
|
|
|
* Croatian (hrvatski)
|
|
|
|
|
*
|
|
|
|
|
* @ingroup Language
|
|
|
|
|
*/
|
2006-07-26 07:15:39 +00:00
|
|
|
class LanguageHr extends Language {
|
2007-11-18 20:15:49 +00:00
|
|
|
|
2011-05-29 15:20:43 +00:00
|
|
|
/**
|
|
|
|
|
* @param $count int
|
|
|
|
|
* @param $forms array
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2007-11-18 20:15:49 +00:00
|
|
|
function convertPlural( $count, $forms ) {
|
2010-07-29 09:43:18 +00:00
|
|
|
if ( !count( $forms ) ) { return ''; }
|
2011-05-17 22:03:20 +00:00
|
|
|
// @todo FIXME: CLDR defines 4 plural forms instead of 3. Plural for for decimals is missing.
|
2009-10-02 18:30:23 +00:00
|
|
|
// http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
|
2007-11-18 20:15:49 +00:00
|
|
|
$forms = $this->preConvertPlural( $forms, 3 );
|
|
|
|
|
|
2010-07-29 09:43:18 +00:00
|
|
|
if ( $count > 10 && floor( ( $count % 100 ) / 10 ) == 1 ) {
|
2007-11-18 20:15:49 +00:00
|
|
|
return $forms[2];
|
2005-10-11 21:12:06 +00:00
|
|
|
} else {
|
2010-07-29 09:43:18 +00:00
|
|
|
switch ( $count % 10 ) {
|
2007-11-18 20:15:49 +00:00
|
|
|
case 1: return $forms[0];
|
2005-10-11 21:12:06 +00:00
|
|
|
case 2:
|
|
|
|
|
case 3:
|
2007-11-18 20:15:49 +00:00
|
|
|
case 4: return $forms[1];
|
|
|
|
|
default: return $forms[2];
|
2005-10-11 21:12:06 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-09-02 19:21:04 +00:00
|
|
|
}
|