summaryrefslogtreecommitdiff
path: root/languages/classes/LanguageGd.php
blob: 6c307f60058aef3c68524aaa547c9c5271aa08a6 (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
29
30
31
32
33
34
35
<?php
/** Scots Gaelic (Gàidhlig)
 *
 * @ingroup Language
 *
 * @author Raimond Spekking
 */
class LanguageGd extends Language {

	/**
	 * Plural form transformations
	 * Based on this discussion: http://translatewiki.net/w/i.php?title=Portal_talk:Gd&oldid=1094065#%C3%80ireamhan
	 *
	 * $forms[0] - singular form (for 1)
	 * $forms[1] - dual form (for 2)
	 * $forms[2] - plural form 1 (for 3-10)
	 * $forms[3] - plural form 2 (for >= 11)
	 *
	 */
	function convertPlural( $count, $forms ) {
		if ( !count($forms) ) { return ''; }
		$forms = $this->preConvertPlural( $forms, 4 );

		$count = abs( $count );
		if ( $count === 1 ) {
			return $forms[0];
		} elseif ( $count === 2 ) {
			return $forms[1];
		} elseif ( $count >= 3 && $count <= 10 ) {
			return $forms[2];
		} else {
			return $forms[3];
		}
	}
}