summaryrefslogtreecommitdiff
path: root/languages/classes/LanguageCy.php
blob: d7727de2367863036a1ac15debbaa40239db1e52 (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
<?php
/** Welsh (Cymraeg)
 *
 * @ingroup Language
 *
 * @author Niklas Laxström
 */
class LanguageCy extends Language {
	function convertPlural( $count, $forms ) {
		if ( !count( $forms ) ) { return ''; }

		// FIXME: CLDR defines 4 plural forms; very different, actually.
		// See http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#cy
		$forms = $this->preConvertPlural( $forms, 6 );
		$count = abs( $count );
		if ( $count >= 0 && $count <= 3 ) {
			return $forms[$count];
		} elseif ( $count == 6 ) {
			return $forms[4];
		} else {
			return $forms[5];
		}
	}
}