Skip to content

Commit 5af608c

Browse files
committed
feat: add zh-CN support
1 parent f380428 commit 5af608c

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-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

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import '../localedata.dart';
2+
import '../identifier_position.dart';
3+
4+
class LocaleZhCN extends ILocaleData {
5+
final String _localeString;
6+
String get localeString => _localeString;
7+
8+
LocaleEn([this._localeString = "zh-CN"]);
9+
10+
String get seconds => '几秒钟';
11+
12+
String get aMinute => '一分钟';
13+
String get minutes => '%i分钟';
14+
15+
String get anHour => '一小时';
16+
String get hours => '%i小时';
17+
18+
String get aDay => '一天';
19+
String get days => '%i天';
20+
21+
String get aMonth => '一个月';
22+
String get months => '%i月';
23+
24+
String get aYear => '一年';
25+
String get years => '%i年';
26+
27+
String get futureIdentifier => '之后';
28+
String get pastIdentifier => '之前';
29+
30+
IdentifierPosition get futurePosition => IdentifierPosition.prepend;
31+
IdentifierPosition get pastPosition => IdentifierPosition.append;
32+
}

0 commit comments

Comments
 (0)