diff --git a/src/i18n/index.ts b/src/i18n/index.ts index 1b712f9..fc406d1 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -5,10 +5,8 @@ import enUS from "./en-US.json"; import zhCN from "./zh-CN.json"; const localStore = new Store("store.bin"); -const language = (await localStore.get("language")) ?? "en-US"; const i18n = createI18n({ - locale: language, allowComposition: true, messages: { "en-US": enUS, @@ -16,4 +14,8 @@ const i18n = createI18n({ }, }); +localStore.get<"en-US" | "zh-CN">("language").then((language) => { + i18n.global.locale = language ?? "en-US"; +}); + export default i18n;