diff --git a/src/client/web/src/i18n/en_US.ts b/src/client/web/src/i18n/en_US.ts new file mode 100644 index 0000000..033f48d --- /dev/null +++ b/src/client/web/src/i18n/en_US.ts @@ -0,0 +1,8 @@ +import { Map } from "immutable"; + +const adContent = ` +If you have any question, you can submit an issue in the github repo. But owner may be out of the office in the weekend 😎.`; + +export const msgs: Map = Map({ + "loader.top.about": "关于", +}); \ No newline at end of file diff --git a/src/client/web/src/i18n/msger.ts b/src/client/web/src/i18n/msger.ts new file mode 100644 index 0000000..9e27600 --- /dev/null +++ b/src/client/web/src/i18n/msger.ts @@ -0,0 +1,27 @@ +import { Map } from "immutable"; + +import { msgs as enMsgs } from "./en_US"; +import { msgs as cnMsgs } from "./zh_CN"; + +export class Msger { + private msgs: Map; + constructor(msgs: Map) { + this.msgs = msgs; + } + getMsg(key: string): string { + return this.msgs.get(key, ""); + } +} + +export class MsgPackage { + static getPkg(key: string): Map { + switch (key) { + case "en-US": + return Map(enMsgs); + case "zh-CN": + return Map(cnMsgs); + default: + return Map(enMsgs); + } + } +} diff --git a/src/client/web/src/i18n/zh_CN.ts b/src/client/web/src/i18n/zh_CN.ts new file mode 100644 index 0000000..94f4f29 --- /dev/null +++ b/src/client/web/src/i18n/zh_CN.ts @@ -0,0 +1,8 @@ +import { Map } from "immutable"; + +const adContent = ` +发现bug等, 可至下方github库提交issue, 不过周末可能不上班😎.`; + +export const msgs: Map = Map({ + "loader.top.about": "关于", +}); \ No newline at end of file