Skip to content

Commit 017c045

Browse files
committed
optimize: 等待il18的初始化完成
1 parent 24e2081 commit 017c045

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/locales/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import locales from './locale';
88
export const reactI18nextInstance = i18n.use(initReactI18next);
99

1010
/** Setup plugin i18n */
11-
export function setupI18n() {
12-
reactI18nextInstance.init({
11+
export async function setupI18n() {
12+
await reactI18nextInstance.init({
1313
interpolation: {
1414
escapeValue: false
1515
},

src/main.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import './plugins/assets';
1111
import { setupI18n } from './locales';
1212
import { setupAppVersionNotification, setupDayjs, setupIconifyOffline, setupLoading, setupNProgress } from './plugins';
1313

14-
function setupApp() {
15-
setupI18n();
14+
async function setupApp() {
15+
await setupI18n();
1616

1717
setupLoading();
1818

0 commit comments

Comments
 (0)