Skip to content

Commit

Permalink
fix(i18n): build error
Browse files Browse the repository at this point in the history
  • Loading branch information
AkiChase committed May 11, 2024
1 parent 4ac263e commit 14d1d75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ import enUS from "./en-US.json";
import zhCN from "./zh-CN.json";

const localStore = new Store("store.bin");
const language = (await localStore.get<string>("language")) ?? "en-US";

const i18n = createI18n({
locale: language,
allowComposition: true,
messages: {
"en-US": enUS,
"zh-CN": zhCN,
},
});

localStore.get<"en-US" | "zh-CN">("language").then((language) => {
i18n.global.locale = language ?? "en-US";
});

export default i18n;

0 comments on commit 14d1d75

Please sign in to comment.