forked from andresaraujo/timeago.dart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlv_messages.dart
107 lines (103 loc) · 2.66 KB
/
lv_messages.dart
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import 'package:timeago/src/messages/lookupmessages.dart';
/// Russian messages
class LvMessages implements LookupMessages {
@override
String prefixAgo() => 'pirms';
@override
String prefixFromNow() => 'pēc';
@override
String suffixAgo() => '';
@override
String suffixFromNow() => '';
@override
String lessThanOneMinute(int seconds) => 'minūtes';
@override
String aboutAMinute(int minutes) => 'minūtes';
@override
String minutes(int minutes) => '$minutes ${_convert(minutes, 'minutes')}';
@override
String aboutAnHour(int minutes) => 'stundas';
@override
String hours(int hours) => '$hours ${_convert(hours, 'hours')}';
@override
String aDay(int hours) => 'dienas';
@override
String days(int days) => '$days ${_convert(days, 'days')}';
@override
String aboutAMonth(int days) => 'mēneša';
@override
String months(int months) => '$months ${_convert(months, 'months')}';
@override
String aboutAYear(int year) => 'gada';
@override
String years(int years) => '$years ${_convert(years, 'years')}';
@override
String wordSeparator() => ' ';
String _convert(int number, String type) {
var mod = number % 10;
if (mod == 1) {
switch (type) {
case 'minutes':
return 'minūtes';
case 'hours':
return 'stundas';
case 'days':
return 'dienas';
case 'months':
return 'mēneša';
case 'years':
return 'gada';
default:
return '';
}
}
switch (type) {
case 'minutes':
return 'minūtēm';
case 'hours':
return 'stundām';
case 'days':
return 'dienām';
case 'months':
return 'mēnešiem';
case 'years':
return 'gadiem';
default:
return '';
}
}
}
class LvShortMessages implements LookupMessages {
@override
String prefixAgo() => '';
@override
String prefixFromNow() => '';
@override
String suffixAgo() => '';
@override
String suffixFromNow() => '';
@override
String lessThanOneMinute(int seconds) => 'tikai tagad';
@override
String aboutAMinute(int minutes) => '1 min.';
@override
String minutes(int minutes) => '$minutes min.';
@override
String aboutAnHour(int minutes) => '~1 st.';
@override
String hours(int hours) => '$hours st.';
@override
String aDay(int hours) => '~1 d.';
@override
String days(int days) => '$days d.';
@override
String aboutAMonth(int days) => '~1 mēn.';
@override
String months(int months) => '$months mēn.';
@override
String aboutAYear(int year) => '~1 g.';
@override
String years(int years) => '$years g.';
@override
String wordSeparator() => ' ';
}