summaryrefslogtreecommitdiff
path: root/languages/classes/LanguageMt.php
blob: 5cf40ce5d58afc38896fd3f075a76257d24369c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

/** Maltese (Malti)
 *
 * @ingroup Language
 *
 * @author Niklas Laxström
 */

class LanguageMt extends Language {

	/**
	 * @param $count int
	 * @param $forms array
	 * @return string
	 */
	function convertPlural( $count, $forms ) {
		if ( !count( $forms ) ) { return ''; }

		$forms = $this->preConvertPlural( $forms, 4 );

		if ( $count == 1 ) $index = 0;
		elseif ( $count == 0 || ( $count % 100 > 1 && $count % 100 < 11 ) ) $index = 1;
		elseif ( $count % 100 > 10 && $count % 100 < 20 ) $index = 2;
		else $index = 3;
		return $forms[$index];
	}
}