From 2e2629fe0ad8637f0cd82b9e7d70764a8f1948e9 Mon Sep 17 00:00:00 2001 From: FrozenArcher Date: Tue, 12 Mar 2024 12:48:58 +0800 Subject: [PATCH] add common text --- src/plain-text/common.ts | 17 +++++++++++++++++ src/plain-text/index.ts | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 src/plain-text/common.ts diff --git a/src/plain-text/common.ts b/src/plain-text/common.ts new file mode 100644 index 0000000..2f50c7b --- /dev/null +++ b/src/plain-text/common.ts @@ -0,0 +1,17 @@ +import { Moment } from 'moment'; + +export interface CommonText { + createdAtText(time: Moment): string; +} + +export const commonTextZhCn: CommonText = { + createdAtText(time: Moment): string { + return '创建于 ' + time.format('YYYY-MM-DD HH:mm'); + }, +}; + +export const commonTextEnUs: CommonText = { + createdAtText(time: Moment): string { + return 'Created at ' + time.format('YYYY-MM-DD HH:mm'); + }, +}; diff --git a/src/plain-text/index.ts b/src/plain-text/index.ts index fc45e9d..392576b 100644 --- a/src/plain-text/index.ts +++ b/src/plain-text/index.ts @@ -15,8 +15,10 @@ import { ticketDetailEnUs, ticketDetailZhCn, } from './TicketDetail'; +import { CommonText, commonTextZhCn } from './common'; interface TextRecord { + common: CommonText; pageFooter: PageFooterText; mainPage: MainPageText; userPage: UserPageText; @@ -33,6 +35,7 @@ interface TextRecord { } const textZhCn: TextRecord = { + common: commonTextZhCn, pageFooter: pageFooterZhCn, mainPage: mainPageZhCn, userPage: userPageZhCn, @@ -49,6 +52,7 @@ const textZhCn: TextRecord = { }; const textEnUs: TextRecord = { + common: commonTextZhCn, pageFooter: pageFooterEnUs, mainPage: mainPageEnUs, userPage: userPageEnUs,