@vlian/framework 1.2.48 → 1.2.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics.umd.js +1 -1
- package/dist/index.umd.js +15 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/kernel/manager/i18nManager.cjs +1 -1
- package/dist/kernel/manager/i18nManager.cjs.map +1 -1
- package/dist/kernel/manager/i18nManager.js +1 -1
- package/dist/kernel/manager/i18nManager.js.map +1 -1
- package/dist/library/locale/index.cjs +13 -2
- package/dist/library/locale/index.cjs.map +1 -1
- package/dist/library/locale/index.d.ts +2 -1
- package/dist/library/locale/index.js +13 -2
- package/dist/library/locale/index.js.map +1 -1
- package/dist/state.umd.js +1 -1
- package/package.json +1 -1
package/dist/analytics.umd.js
CHANGED
package/dist/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @vlian/framework v1.2.
|
|
2
|
+
* @vlian/framework v1.2.48
|
|
3
3
|
* Secra Framework - 一个现代化的低代码框架
|
|
4
4
|
* (c) 2026 Secra Framework Contributors
|
|
5
5
|
* Licensed under Apache-2.0
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
+
let setupPromise = null;
|
|
76
77
|
/** Setup plugin i18n */ function setupI18n(otherLocales = {
|
|
77
78
|
'en-US': {},
|
|
78
79
|
'zh-CN': {}
|
|
@@ -85,13 +86,23 @@
|
|
|
85
86
|
translation: Object.assign({}, local, otherLocales['zh-CN'])
|
|
86
87
|
}
|
|
87
88
|
};
|
|
88
|
-
i18n.
|
|
89
|
+
if (i18n.isInitialized) {
|
|
90
|
+
i18n.addResourceBundle('en-US', 'translation', locales['en-US'].translation, true, true);
|
|
91
|
+
i18n.addResourceBundle('zh-CN', 'translation', locales['zh-CN'].translation, true, true);
|
|
92
|
+
return Promise.resolve(i18n);
|
|
93
|
+
}
|
|
94
|
+
if (setupPromise) {
|
|
95
|
+
return setupPromise;
|
|
96
|
+
}
|
|
97
|
+
const initPromise = i18n.use(reactI18next.initReactI18next).init({
|
|
89
98
|
interpolation: {
|
|
90
99
|
escapeValue: false
|
|
91
100
|
},
|
|
92
101
|
lng: 'zh-CN',
|
|
93
102
|
resources: locales
|
|
94
|
-
});
|
|
103
|
+
}).then(()=>i18n);
|
|
104
|
+
setupPromise = initPromise;
|
|
105
|
+
return initPromise;
|
|
95
106
|
}
|
|
96
107
|
const $t = i18n.t;
|
|
97
108
|
function setLang(locale) {
|
|
@@ -12549,7 +12560,7 @@
|
|
|
12549
12560
|
} else {
|
|
12550
12561
|
await writePersistedValue(this.config.persistence, JSON.stringify(this.snapshot));
|
|
12551
12562
|
}
|
|
12552
|
-
setupI18n(this.snapshot.resources || {});
|
|
12563
|
+
await setupI18n(this.snapshot.resources || {});
|
|
12553
12564
|
setLang(this.snapshot.locale);
|
|
12554
12565
|
}
|
|
12555
12566
|
getSnapshot() {
|