Skip to content

Commit 07d2e49

Browse files
committed
feat: add zh-CN support
1 parent f380428 commit 07d2e49

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

lib/simple_moment.dart

+1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ export 'src/locales/nl.dart';
2020
export 'src/locales/vi.dart';
2121
export 'src/locales/km.dart';
2222
export 'src/locales/ko.dart';
23+
export 'src/locales/zh_CN.dart';
2324
export 'src/simple_moment_base.dart';

lib/src/locales/zh_CN.dart

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import '../localedata.dart';
2+
import '../identifier_position.dart';
3+
4+
5+
class LocaleZhCN extends ILocaleData {
6+
final String _localeString;
7+
8+
@override
9+
String get localeString => _localeString;
10+
11+
LocaleZhCN([this._localeString = "zh-CN"]);
12+
13+
@override
14+
String get seconds => '几秒钟';
15+
16+
@override
17+
String get aMinute => '一分钟';
18+
19+
@override
20+
String get minutes => '%i分钟';
21+
22+
@override
23+
String get anHour => '一小时';
24+
25+
@override
26+
String get hours => '%i小时';
27+
28+
@override
29+
String get aDay => '一天';
30+
31+
@override
32+
String get days => '%i天';
33+
34+
@override
35+
String get aMonth => '一个月';
36+
37+
@override
38+
String get months => '%i月';
39+
40+
@override
41+
String get aYear => '一年';
42+
43+
@override
44+
String get years => '%i年';
45+
46+
@override
47+
String get futureIdentifier => '之后';
48+
49+
@override
50+
String get pastIdentifier => '之前';
51+
52+
@override
53+
IdentifierPosition get futurePosition => IdentifierPosition.prepend;
54+
55+
@override
56+
IdentifierPosition get pastPosition => IdentifierPosition.append;
57+
}

0 commit comments

Comments
 (0)