This repository was archived by the owner on Jun 15, 2022. It is now read-only.
forked from oblik/php-pluralization
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWelshLanguage.php
More file actions
69 lines (65 loc) · 1.46 KB
/
WelshLanguage.php
File metadata and controls
69 lines (65 loc) · 1.46 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
namespace Oblik\Pluralization;
class WelshLanguage extends Language
{
static function cardinal(float $n, int $i, int $v)
{
if ($n == 0) {
return ZERO;
}
elseif ($n == 1) {
return ONE;
}
elseif ($n == 2) {
return TWO;
}
elseif ($n == 3) {
return FEW;
}
elseif ($n == 6) {
return MANY;
}
return OTHER;
}
static function ordinal(int $n)
{
if ($n == 0 || $n == 7 || $n == 8 || $n == 9) {
return ZERO;
}
elseif ($n == 1) {
return ONE;
}
elseif ($n == 2) {
return TWO;
}
elseif ($n == 3 || $n == 4) {
return FEW;
}
elseif ($n == 5 || $n == 6) {
return MANY;
}
return OTHER;
}
const RANGE = [
zero . one => one,
zero . two => two,
zero . few => few,
zero . many => many,
zero . other => other,
one . two => two,
one . few => few,
one . many => many,
one . other => other,
two . few => few,
two . many => many,
two . other => other,
few . many => many,
few . other => other,
many . other => other,
other . one => one,
other . two => two,
other . few => few,
other . many => many,
other . other => other,
];
}