Skip to content

feat: add language support for zh_CN #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/simple_moment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ export 'src/locales/nl.dart';
export 'src/locales/vi.dart';
export 'src/locales/km.dart';
export 'src/locales/ko.dart';
export 'src/locales/zh_CN.dart';
export 'src/simple_moment_base.dart';
57 changes: 57 additions & 0 deletions lib/src/locales/zh_CN.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import '../localedata.dart';
import '../identifier_position.dart';


class LocaleZhCN extends ILocaleData {
final String _localeString;

@override
String get localeString => _localeString;

LocaleZhCN([this._localeString = "zh-CN"]);

@override
String get seconds => '几秒钟';

@override
String get aMinute => '一分钟';

@override
String get minutes => '%i分钟';

@override
String get anHour => '一小时';

@override
String get hours => '%i小时';

@override
String get aDay => '一天';

@override
String get days => '%i天';

@override
String get aMonth => '一个月';

@override
String get months => '%i月';

@override
String get aYear => '一年';

@override
String get years => '%i年';

@override
String get futureIdentifier => '之后';

@override
String get pastIdentifier => '之前';

@override
IdentifierPosition get futurePosition => IdentifierPosition.prepend;

@override
IdentifierPosition get pastPosition => IdentifierPosition.append;
}