Make the javascript implementation of Macedonian(mk) plural consistant with php side...
[lhc/web/wiklou.git] / languages / classes / LanguageMk.php
1 <?php
2 /**
3 * Macedonian (Македонски)
4 *
5 * @ingroup Language
6 */
7 class LanguageMk extends Language {
8 /**
9 * Plural forms per
10 * http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#mk
11 *
12 * @param $count int
13 * @param $forms array
14 *
15 * @return string
16 */
17 function convertPlural( $count, $forms ) {
18 if ( !count( $forms ) ) { return ''; }
19 $forms = $this->preConvertPlural( $forms, 2 );
20 // TODO CLDR defines forms[0] for n != 11 and not for n%100 !== 11
21 if ( $count % 10 === 1 && $count % 100 !== 11 ) {
22 return $forms[0];
23 } else {
24 return $forms[1];
25 }
26 }
27 }