forked from SerhiiCho/timeago
-
Notifications
You must be signed in to change notification settings - Fork 0
/
en.go
44 lines (42 loc) · 895 Bytes
/
en.go
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
package timeago
func getEnglish() map[string]string {
return map[string]string{
"ago": "ago",
"online": "Online",
"now": "Now",
// Seconds
"second": "second",
"seconds": "seconds",
"seconds2": "seconds",
// Minutes
"minute": "minute",
"minutes": "minutes",
"minutes2": "minutes",
// Hours
"hour": "hour",
"hours": "hours",
"hours2": "hours",
// Days
"day": "day",
"days": "days",
"days2": "days",
// Weeks
"week": "week",
"weeks": "weeks",
"weeks2": "weeks",
// Months
"month": "month",
"months": "months",
"months2": "months",
// Years
"year": "year",
"years": "years",
"years2": "years",
}
}
func getEnglishRule() Rule {
return Rule{
Single: func(number int64, lastDigit int) bool { return number == 1 },
Plural: func(number int64, lastDigit int) bool { return number > 1 || number == 0 },
}
}