summaryrefslogtreecommitdiff
path: root/languages/classes/LanguageKsh.php
blob: b21cc4d7a5cf2012375d7925bbf7ff9d4f35d79f (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
36
<?php

/** Ripuarian (Ripoarėsh)
 *
 * @ingroup Language
 *
 * @author Purodha Blissenbach
 */
class LanguageKsh extends Language {
	/**
	 * Avoid grouping whole numbers between 0 to 9999
	 */
	public function commafy( $_ ) {
		if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
			return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
		} else {
			return $_;
		}
	}

	/**
	 * Handle cases of (1, other, 0) or (1, other)
	 */
	function convertPlural( $count, $forms ) {
		if ( !count($forms) ) { return ''; }
		$forms = $this->preConvertPlural( $forms, 3 );

		if ( $count == 1 ) {
			return $forms[0];
		} elseif ( $count == 0 ) {
			return $forms[2];
		} else {
			return $forms[1];
		}
	}
}