diff --git a/src/plain-text/MainPage.ts b/src/plain-text/MainPage.ts new file mode 100644 index 0000000..c907ec3 --- /dev/null +++ b/src/plain-text/MainPage.ts @@ -0,0 +1,41 @@ +export interface MainPageText { + mainTitleLine: string; + subTitleLine: string; + cardTitle: { + dutyInfo: string; + stepInfo: string; + tipsInfo: string; + }; + expandTitle: { + stepInfo: string; + tipsInfo: string; + }; + stepList: Array<{ title: string }>; + tipsList: Array<{ title: string }>; +} + +export const mainPageZhCn: 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: '我们是志愿服务,不收任何礼物哦~' }, + ], +}; diff --git a/src/plain-text/PageFooter.ts b/src/plain-text/PageFooter.ts new file mode 100644 index 0000000..ac20e88 --- /dev/null +++ b/src/plain-text/PageFooter.ts @@ -0,0 +1,7 @@ +export interface PageFooterText { + dividerText: string; +} + +export const pageFooterZhCn: PageFooterText = { + dividerText: 'EVA Notify', +}; diff --git a/src/plain-text/index.ts b/src/plain-text/index.ts new file mode 100644 index 0000000..bb3fdea --- /dev/null +++ b/src/plain-text/index.ts @@ -0,0 +1,40 @@ +import { PageFooterText, pageFooterZhCn } from './PageFooter'; +import { MainPageText, mainPageZhCn } from './MainPage'; + +interface TextRecord { + pageFooter: PageFooterText; + mainPage: MainPageText; +} + +const textZhCn: TextRecord = { + pageFooter: pageFooterZhCn, + mainPage: mainPageZhCn, +}; + +// type Lang = 'zh_CN' | 'en_US' | ...; +type Lang = 'zh_CN'; + +class PlainText { + private readonly textZhCn: TextRecord; + private lang: Lang; + + constructor() { + this.textZhCn = textZhCn; + this.lang = 'zh_CN'; + } + + setLang(lang: Lang) { + this.lang = lang; + } + + get(): TextRecord { + if (this.lang == 'zh_CN') { + return this.textZhCn; + } + return this.textZhCn; + } +} + +const pt = new PlainText(); + +export default pt;