From c63b7fcca825cc554f0efd69e4e64911dfa554dd Mon Sep 17 00:00:00 2001 From: Dawn_Ocean <1785590531@qq.com> Date: Thu, 7 Mar 2024 11:45:34 +0800 Subject: [PATCH] add en_US structure for plain-text --- src/plain-text/MainPage.ts | 49 ++++++++++++++++++++++++++++++++++++ src/plain-text/PageFooter.ts | 4 +++ src/plain-text/UserPage.ts | 21 ++++++++++++++++ src/plain-text/index.ts | 18 ++++++++++--- 4 files changed, 88 insertions(+), 4 deletions(-) diff --git a/src/plain-text/MainPage.ts b/src/plain-text/MainPage.ts index e804739..ba20466 100644 --- a/src/plain-text/MainPage.ts +++ b/src/plain-text/MainPage.ts @@ -75,3 +75,52 @@ export const mainPageZhCn: MainPageText = { }, }, }; + +export const mainPageEnUs: MainPageText = { + mainTitleLine: '您好,这里是E志者协会', + subTitleLine: '维修请至【东三-204】实验室', + cardTitle: { + dutyInfo: '204值班情况', + stepInfo: '维修步骤', + tipsInfo: '注意事项', + }, + expandTitle: { + stepInfo: '查看维修步骤', + tipsInfo: '查看注意事项', + }, + stepList: [ + { title: '线上填写工单' }, + { title: '去`东三-204`实验室维修电脑' }, + { title: '等待电脑维修' }, + { title: '维修结束,取回电脑' }, + ], + tipsList: [ + { title: '戴尔、Surface、外星人、苹果电脑不能拆机哦~' }, + { title: '数据无价,请随时做好数据备份哦~' }, + { title: '204也是实验室,请遵守实验室纪律,请勿饮食~' }, + { title: '我们是志愿服务,不收任何礼物哦~' }, + ], + dutyCard: { + offDuty: { + title: '未值班', + reason: s => '值班停止原因:' + s, + recoverTime: t => '恢复值班时间:' + t, + }, + inDuty: { + title: '值班中', + currentDutyText: c => { + switch (c) { + case 'off': + return '当前未值班'; + case '1': + return '第一班 13:30-16:00'; + case '2': + return '第二班 16:00-18:00'; + case '3': + return '第三班 18:00-20:30'; + } + }, + inDutyCnt: n => '当前值班人数:' + n, + }, + }, +}; diff --git a/src/plain-text/PageFooter.ts b/src/plain-text/PageFooter.ts index ac20e88..4cba68a 100644 --- a/src/plain-text/PageFooter.ts +++ b/src/plain-text/PageFooter.ts @@ -5,3 +5,7 @@ export interface PageFooterText { export const pageFooterZhCn: PageFooterText = { dividerText: 'EVA Notify', }; + +export const pageFooterEnUs: PageFooterText = { + dividerText: 'EVA Notify', +}; diff --git a/src/plain-text/UserPage.ts b/src/plain-text/UserPage.ts index ed2aae8..922c7fc 100644 --- a/src/plain-text/UserPage.ts +++ b/src/plain-text/UserPage.ts @@ -39,3 +39,24 @@ export const userPageZhCn: UserPageText = { note: '有什么想说的都可以告诉亦可哦!', }, }; + +export const userPageEnUs: UserPageText = { + mainTitleLine: '您好,这里是E志者协会', + subTitleLine: '维修请至【东三-204】实验室', + ticketColumn: { + title: '我的工单', + note: '在这里查看历史工单!', + }, + infoColumn: { + title: '我的信息', + note: '能帮助亦可更好地找到你哦!', + }, + settingsColumn: { + title: 'Settings', + note: '在这里配置小程序', + }, + reportColumn: { + title: '意见反馈', + note: '有什么想说的都可以告诉亦可哦!', + }, +}; diff --git a/src/plain-text/index.ts b/src/plain-text/index.ts index 4f846c5..02514ce 100644 --- a/src/plain-text/index.ts +++ b/src/plain-text/index.ts @@ -1,6 +1,6 @@ -import { PageFooterText, pageFooterZhCn } from './PageFooter'; -import { MainPageText, mainPageZhCn } from './MainPage'; -import { UserPageText, userPageZhCn } from './UserPage'; +import { PageFooterText, pageFooterZhCn, pageFooterEnUs } from './PageFooter'; +import { MainPageText, mainPageZhCn, mainPageEnUs } from './MainPage'; +import { UserPageText, userPageZhCn, userPageEnUs } from './UserPage'; interface TextRecord { pageFooter: PageFooterText; @@ -14,15 +14,23 @@ const textZhCn: TextRecord = { userPage: userPageZhCn, }; +const textEnUs: TextRecord = { + pageFooter: pageFooterEnUs, + mainPage: mainPageEnUs, + userPage: userPageEnUs, +}; + // type Lang = 'zh_CN' | 'en_US' | ...; -type Lang = 'zh_CN'; +type Lang = 'zh_CN' | 'en_US'; class PlainText { private readonly textZhCn: TextRecord; + private readonly textEnUs: TextRecord; private lang: Lang; constructor() { this.textZhCn = textZhCn; + this.textEnUs = textEnUs; this.lang = 'zh_CN'; } @@ -33,6 +41,8 @@ class PlainText { get(): TextRecord { if (this.lang == 'zh_CN') { return this.textZhCn; + } else if (this.lang == 'en_US') { + return this.textEnUs; } return this.textZhCn; }