add global plain text

yhy
FrozenArcher 2024-03-06 00:02:00 +08:00
parent 83d2e8419e
commit a9d9415def
3 changed files with 88 additions and 0 deletions

View File

@ -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: '我们是志愿服务,不收任何礼物哦~' },
],
};

View File

@ -0,0 +1,7 @@
export interface PageFooterText {
dividerText: string;
}
export const pageFooterZhCn: PageFooterText = {
dividerText: 'EVA Notify',
};

View File

@ -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;